예제 #1
0
        public void TestInput()
        {
            NavigateToDictionary(_app);

            var parser = new Parser();
            var keys = parser.Parse("iThe is the most common word.<esc>jjiAnd is 3rd.<esc>/that<cr>iThat is 7.<esc><tab>iSpaceMetaphor<cret");
        }
예제 #2
0
        private void NavigateToDictionary(IApplication app)
        {
            var parser = new Parser();
            var keys = parser.Parse("/dict<cr>l<cr>");
            var cmds = keys.Select(key => app.KeyGen.ProcessKey(key)).Flatten().ToList();
            //todo: It seems there's a problem.  KeyGen must handle state of shift, normal mode, etc.
            //otherwise, I can't just get a list of commands from ProcessKey
            //But then the app needs to be able to set the mode
            //And I need a command that targets KeyGen

            cmds.Do(a => a.Invoke(app));

            //            app.KeyGen.ProcessKeyString("/notes<cr>l<cr>").Do(a => a.Invoke(app));

            var execedCmds = _cmdFactory.RequestedExpressions.Select(expression => expression.ToString()).ToList();
            Assert.AreEqual("a => a.SetMode(Search)", execedCmds[0]);
            Assert.IsInstanceOfType(typeof(ITextEditor), app.CurrentView);
        }