vim-patch:7.4.1151

Problem:    Missing change to eval.c
Solution:   Also change feedkeys().

5f8a14b9de
This commit is contained in:
Michael Ennen
2016-05-22 01:33:27 -07:00
parent 40e7efe91c
commit 24a329b53a
5 changed files with 38 additions and 29 deletions

View File

@@ -57,6 +57,7 @@ void vim_feedkeys(String keys, String mode, Boolean escape_csi)
bool remap = true;
bool insert = false;
bool typed = false;
bool execute = false;
if (keys.size == 0) {
return;
@@ -68,6 +69,7 @@ void vim_feedkeys(String keys, String mode, Boolean escape_csi)
case 'm': remap = true; break;
case 't': typed = true; break;
case 'i': insert = true; break;
case 'x': execute = true; break;
}
}
@@ -86,8 +88,12 @@ void vim_feedkeys(String keys, String mode, Boolean escape_csi)
xfree(keys_esc);
}
if (vgetc_busy)
if (vgetc_busy) {
typebuf_was_filled = true;
}
if (execute) {
exec_normal(true);
}
}
/// Passes input keys to Neovim. Unlike `vim_feedkeys`, this will use a

View File

@@ -7863,7 +7863,10 @@ void exec_normal_cmd(char_u *cmd, int remap, bool silent)
exec_normal(false);
}
void exec_normal(int was_typed)
/// Execute normal_cmd() until there is no typeahead left.
///
/// @param was_typed whether or not something was typed
void exec_normal(bool was_typed)
{
oparg_T oa;

View File

@@ -1754,9 +1754,9 @@ static int vgetorpeek(int advance)
|| ((compl_cont_status & CONT_LOCAL)
&& (c1 == Ctrl_N || c1 == Ctrl_P)))
) {
if (c1 == K_SPECIAL)
if (c1 == K_SPECIAL) {
nolmaplen = 2;
else {
} else {
LANGMAP_ADJUST(c1, (State & (CMDLINE | INSERT)) == 0
&& get_real_state() != SELECTMODE);
nolmaplen = 0;

View File

@@ -1,24 +1,24 @@
" tests for 'langmap'
func Test_langmap()
new
set langmap=}l,^x,%v
call setline(1, ['abc'])
call feedkeys('gg0}^', 'tx')
call assert_equal('ac', getline(1))
" in Replace mode
" need silent! to avoid a delay when entering Insert mode
call setline(1, ['abcde'])
silent! call feedkeys("gg0lR%{z\<Esc>00", 'tx')
call assert_equal('a%{ze', getline(1))
" in Select mode
" need silent! to avoid a delay when entering Insert mode
call setline(1, ['abcde'])
silent! call feedkeys("gg0}%}\<C-G>}^\<Esc>00", 'tx')
call assert_equal('a}^de', getline(1))
quit!
endfunc
" tests for 'langmap'
func Test_langmap()
new
set langmap=}l,^x,%v
call setline(1, ['abc'])
call feedkeys('gg0}^', 'tx')
call assert_equal('ac', getline(1))
" in Replace mode
" need silent! to avoid a delay when entering Insert mode
call setline(1, ['abcde'])
silent! call feedkeys("gg0lR%{z\<Esc>00", 'tx')
call assert_equal('a%{ze', getline(1))
" in Select mode
" need silent! to avoid a delay when entering Insert mode
call setline(1, ['abcde'])
silent! call feedkeys("gg0}%}\<C-G>}^\<Esc>00", 'tx')
call assert_equal('a}^de', getline(1))
quit!
endfunc

View File

@@ -542,7 +542,7 @@ static int included_patches[] = {
// 1154 NA
// 1153,
// 1152 NA
// 1151,
1151,
1150,
1149,
// 1148 NA