Compare commits

...

16 Commits

Author SHA1 Message Date
asmka
f4f579b46b patch 8.2.4857: Yaml indent for multiline is wrong
Problem:    Yaml indent for multiline is wrong.
Solution:   Adjust patterns. (closes #10328, closes #8740)
2022-05-02 10:46:49 +01:00
Christian Brabandt
2890c0b9d2 patch 8.2.4856: MinGW compiler complains about unknown escape sequence
Problem:    MinGW compiler complains about unknown escape sequence.
Solution:   Avoid using a backslash in path. (Christian Brabandt,
            closes #10337)
2022-05-02 10:34:15 +01:00
Zoe Roux
2096a5f128 patch 8.2.4855: robot files are not recognized
Problem:    Robot files are not recognized.
Solution:   Add patterns for robot files. (Zoe Roux, closes #10339)
2022-05-02 10:29:31 +01:00
Christian Brabandt
2f7e00a8ae patch 8.2.4854: array size does not match usage
Problem:    Array size does not match usage.
Solution:   Make array size 3 instead of 4. (Christian Brabandt, closes #10336)
2022-05-02 00:06:51 +01:00
Philip H
056a1c2bdd patch 8.2.4853: CI with FreeBSD is a bit outdated
Problem:    CI with FreeBSD is a bit outdated.
Solution:   Use 12.3 instead of 12.1. (closes #10333)
2022-05-01 20:43:50 +01:00
LemonBoy
d2a4662430 patch 8.2.4852: ANSI color index to RGB value not correct
Problem:    ANSI color index to RGB value not correct.
Solution:   Convert the cterm index to ANSI index. (closes #10321,
            closes #9836))
2022-05-01 17:43:33 +01:00
Bram Moolenaar
b4011afe53 patch 8.2.4851: compiler warning for uninitialized variable
Problem:    Compiler warning for uninitialized variable.
Solution:   Use another variable to decide to restore option values.
2022-05-01 00:42:24 +01:00
LemonBoy
d7c9564d8d patch 8.2.4850: mksession mixes up "tabpages" and "curdir" arguments
Problem:    Mksession mixes up "tabpages" and "curdir" arguments.
Solution:   Correct logic for storing tabpage in session. (closes #10312)
2022-04-30 16:10:27 +01:00
Mathias Jean Johansen
917c32c4f7 patch 8.2.4849: Gleam filetype not detected
Problem:    Gleam filetype not detected.
Solution:   Add a pattern for Gleam files. (Mathias Jean Johansen,
            closes #10326)
2022-04-30 15:10:07 +01:00
zeertzjq
ee44603069 patch 8.2.4848: local completion with mappings and simplification not working
Problem:    Local completion with mappings and simplification not working.
Solution:   Fix local completion <C-N>/<C-P> mappings not ignored if keys are
            not simplified. (closes #10323)
2022-04-30 15:02:22 +01:00
LemonBoy
a5d3590505 patch 8.2.4847: crash when using uninitialized function pointer
Problem:    Crash when using uninitialized function pointer.
Solution:   Check for NULL pointer. (closes #10319, closes #10319)
2022-04-29 21:15:02 +01:00
zeertzjq
bad8a013c2 patch 8.2.4846: termcodes test fails
Problem:    Termcodes test fails.
Solution:   use CTRL-SHIFT-V to insert an unsimplified key. (closes #10316)
2022-04-29 16:44:00 +01:00
zeertzjq
590f365f91 patch 8.2.4845: duplicate code
Problem:    Duplicate code.
Solution:   Move code below if/else. (closes #10314)
2022-04-29 11:29:54 +01:00
zeertzjq
758a8d1999 patch 8.2.4844: <C-S-I> is simplified to <S-Tab>
Problem:    <C-S-I> is simplified to <S-Tab>.
Solution:   Do not simplify CTRL if there is also SHIFT. (closes #10313)
2022-04-29 11:06:34 +01:00
LemonBoy
202b4bd3a4 patch 8.2.4843: treating CTRL + ALT as AltGr is not backwards compatible
Problem:    Win32 GUI: Treating CTRL + ALT as AltGr is not backwards
            compatible. (Axel Bender)
Solution:   Make a difference between left and right menu keys.
            (closes #10308)
2022-04-28 19:50:54 +01:00
Bram Moolenaar
211a5bb235 patch 8.2.4842: expand("%:p") is not empty when there is no buffer name
Problem:    expand("%:p") is not empty when there is no buffer name.
Solution:   When ignoring errors still return NULL. (closes #10311)
2022-04-28 19:09:03 +01:00
21 changed files with 241 additions and 82 deletions

View File

@@ -6,9 +6,10 @@ freebsd_12_task:
only_if: $CIRRUS_TAG == ''
timeout_in: 20m
freebsd_instance:
image: freebsd-12-1-release-amd64
image: freebsd-12-3-release-amd64
install_script:
pkg install -y gettext
- pkg update -f
- pkg install -y gettext
build_script:
- NPROC=$(getconf _NPROCESSORS_ONLN)
- ./configure --with-features=${FEATURES}

View File

@@ -364,6 +364,8 @@ jobs:
LUA32_URL: https://downloads.sourceforge.net/luabinaries/lua-%LUA_RELEASE%_Win32_dllw6_lib.zip
LUA64_URL: https://downloads.sourceforge.net/luabinaries/lua-%LUA_RELEASE%_Win64_dllw6_lib.zip
LUA_DIR: D:\Lua
# do not want \L to end up in pathdef.c and compiler complaining about unknown escape sequences \l
LUA_DIR_SLASH: D:/Lua
# Python 2
PYTHON_VER: 27
PYTHON_VER_DOT: '2.7'
@@ -510,7 +512,7 @@ jobs:
mingw32-make -f Make_ming.mak -j2 \
FEATURES=${{ matrix.features }} \
GUI=yes IME=yes ICONV=yes VIMDLL=yes \
DYNAMIC_LUA=yes LUA=${LUA_DIR} \
DYNAMIC_LUA=yes LUA=${LUA_DIR_SLASH} \
DYNAMIC_PYTHON=yes PYTHON=${PYTHON_DIR} \
DYNAMIC_PYTHON3=yes PYTHON3=${PYTHON3_DIR} \
STATIC_STDCPLUS=yes COVERAGE=${{ matrix.coverage }}

View File

@@ -87,6 +87,7 @@ CTRL-Q Same as CTRL-V. But with some terminals it is used for
CTRL-SHIFT-V *c_CTRL-SHIFT-V* *c_CTRL-SHIFT-Q*
CTRL-SHIFT-Q Works just like CTRL-V, unless |modifyOtherKeys| is active,
then it inserts the Escape sequence for a key with modifiers.
In the GUI the |key-notation| is inserted without simplifying.
*c_<Left>* *c_Left*
<Left> cursor left

View File

@@ -719,6 +719,9 @@ au BufNewFile,BufRead *.git/*
" Gkrellmrc
au BufNewFile,BufRead gkrellmrc,gkrellmrc_? setf gkrellmrc
" Gleam
au BufNewFile,BufRead *.gleam setf gleam
" GLSL
au BufNewFile,BufRead *.glsl setf glsl
@@ -1589,6 +1592,9 @@ au BufNewFile,BufRead *.rng setf rng
" RPL/2
au BufNewFile,BufRead *.rpl setf rpl
" Robot Framework
au BufNewFile,BufRead *.robot,*.resource setf robot
" Robots.txt
au BufNewFile,BufRead robots.txt setf robots

View File

@@ -17,3 +17,9 @@ map: val
map: multiline
value
# END_INDENT
# START_INDENT
map: |
line1
line2
# END_INDENT

View File

@@ -17,3 +17,9 @@ map: val
map: multiline
value
# END_INDENT
# START_INDENT
map: |
line1
line2
# END_INDENT

View File

@@ -1899,7 +1899,11 @@ get_literal(int noReduceKeys)
* vi-compatible (maybe there should be an option for it?) -- webb
*/
if (gui.in_use)
{
++allow_keys;
if (noReduceKeys)
++no_reduce_keys;
}
#endif
#ifdef USE_ON_FLY_SCROLL
dont_scroll = TRUE; // disallow scrolling here
@@ -1992,7 +1996,11 @@ get_literal(int noReduceKeys)
--no_mapping;
#ifdef FEAT_GUI
if (gui.in_use)
{
--allow_keys;
if (noReduceKeys)
--no_reduce_keys;
}
#endif
if (nc)
{

View File

@@ -5314,7 +5314,8 @@ echo_string_core(
if (echo_style)
{
r = make_ufunc_name_readable(tv->vval.v_string,
r = tv->vval.v_string == NULL ? (char_u *)"function()"
: make_ufunc_name_readable(tv->vval.v_string,
buf, MAX_FUNC_NAME_LEN);
if (r == buf)
{

View File

@@ -9349,12 +9349,15 @@ eval_vars(
}
}
if (empty_is_error && (resultlen == 0 || valid != VALID_HEAD + VALID_PATH))
if (resultlen == 0 || valid != VALID_HEAD + VALID_PATH)
{
if (valid != VALID_HEAD + VALID_PATH)
*errormsg = _(e_empty_file_name_for_percent_or_hash_only_works_with_ph);
else
*errormsg = _(e_evaluates_to_an_empty_string);
if (empty_is_error)
{
if (valid != VALID_HEAD + VALID_PATH)
*errormsg = _(e_empty_file_name_for_percent_or_hash_only_works_with_ph);
else
*errormsg = _(e_evaluates_to_an_empty_string);
}
result = NULL;
}
else

View File

@@ -2342,10 +2342,10 @@ typedef enum {
/*
* Check if the bytes at the start of the typeahead buffer are a character used
* in CTRL-X mode. This includes the form with a CTRL modifier.
* in Insert mode completion. This includes the form with a CTRL modifier.
*/
static int
at_ctrl_x_key(void)
at_ins_compl_key(void)
{
char_u *p = typebuf.tb_buf + typebuf.tb_off;
int c = *p;
@@ -2355,7 +2355,8 @@ at_ctrl_x_key(void)
&& p[1] == KS_MODIFIER
&& (p[2] & MOD_MASK_CTRL))
c = p[3] & 0x1f;
return vim_is_ctrl_x_key(c);
return (ctrl_x_mode_not_default() && vim_is_ctrl_x_key(c))
|| (compl_status_local() && (c == Ctrl_N || c == Ctrl_P));
}
/*
@@ -2486,9 +2487,7 @@ handle_mapping(
&& !(State == HITRETURN && (tb_c1 == CAR || tb_c1 == ' '))
&& State != ASKMORE
&& State != CONFIRM
&& !((ctrl_x_mode_not_default() && at_ctrl_x_key())
|| (compl_status_local()
&& (tb_c1 == Ctrl_N || tb_c1 == Ctrl_P))))
&& !at_ins_compl_key())
{
#ifdef FEAT_GUI
if (gui.in_use && tb_c1 == CSI && typebuf.tb_len >= 2

View File

@@ -827,13 +827,13 @@ get_active_modifiers(void)
modifiers |= MOD_MASK_CTRL;
if (GetKeyState(VK_SHIFT) & 0x8000)
modifiers |= MOD_MASK_SHIFT;
if (GetKeyState(VK_MENU) & 0x8000)
modifiers |= MOD_MASK_ALT;
// Windows handles Ctrl + Alt as AltGr, in that case no modifier is actually
// Windows handles Ctrl + Alt as AltGr and vice-versa. We can distinguish
// the two cases by checking whether the left or the right Alt key is
// pressed.
if ((modifiers & (MOD_MASK_CTRL | MOD_MASK_ALT)) ==
(MOD_MASK_CTRL | MOD_MASK_ALT))
modifiers &= ~(MOD_MASK_CTRL | MOD_MASK_ALT);
if (GetKeyState(VK_LMENU) & 0x8000)
modifiers |= MOD_MASK_ALT;
if ((modifiers & MOD_MASK_CTRL) && (GetKeyState(VK_RMENU) & 0x8000))
modifiers &= ~MOD_MASK_CTRL;
return modifiers;
}
@@ -955,7 +955,7 @@ _OnMouseEvent(
vim_modifiers |= MOUSE_SHIFT;
if (keyFlags & MK_CONTROL)
vim_modifiers |= MOUSE_CTRL;
if (GetKeyState(VK_MENU) & 0x8000)
if (GetKeyState(VK_LMENU) & 0x8000)
vim_modifiers |= MOUSE_ALT;
gui_send_mouse_event(button, x, y, repeated_click, vim_modifiers);
@@ -1722,8 +1722,8 @@ gui_mch_haskey(char_u *name)
int i;
for (i = 0; special_keys[i].vim_code1 != NUL; i++)
if (name[0] == special_keys[i].vim_code0 &&
name[1] == special_keys[i].vim_code1)
if (name[0] == special_keys[i].vim_code0
&& name[1] == special_keys[i].vim_code1)
return OK;
return FAIL;
}
@@ -1972,7 +1972,7 @@ process_message(void)
{
// ignore VK_SPACE when ALT key pressed: system menu
if (special_keys[i].key_sym == vk
&& (vk != VK_SPACE || !(GetKeyState(VK_MENU) & 0x8000)))
&& (vk != VK_SPACE || !(GetKeyState(VK_LMENU) & 0x8000)))
{
/*
* Behave as expected if we have a dead key and the special key
@@ -2051,8 +2051,8 @@ process_message(void)
if (GetKeyState(VK_CAPITAL) & 0x0001)
keyboard_state[VK_CAPITAL] = 0x01;
// Alt-Gr is synthesized as Alt + Ctrl.
if ((GetKeyState(VK_MENU) & 0x8000) &&
(GetKeyState(VK_CONTROL) & 0x8000))
if ((GetKeyState(VK_RMENU) & 0x8000)
&& (GetKeyState(VK_CONTROL) & 0x8000))
{
keyboard_state[VK_MENU] = 0x80;
keyboard_state[VK_CONTROL] = 0x80;

View File

@@ -673,11 +673,6 @@ get_mode(char_u *buf)
{
buf[i++] = 'R';
buf[i++] = 'v';
if (ins_compl_active())
buf[i++] = 'c';
else if (ctrl_x_mode_not_defined_yet())
buf[i++] = 'x';
}
else
{
@@ -685,12 +680,12 @@ get_mode(char_u *buf)
buf[i++] = 'R';
else
buf[i++] = 'i';
if (ins_compl_active())
buf[i++] = 'c';
else if (ctrl_x_mode_not_defined_yet())
buf[i++] = 'x';
}
if (ins_compl_active())
buf[i++] = 'c';
else if (ctrl_x_mode_not_defined_yet())
buf[i++] = 'x';
}
else if ((State & CMDLINE) || exmode_active)
{

View File

@@ -620,16 +620,17 @@ makeopens(
int only_save_windows = TRUE;
int nr;
int restore_size = TRUE;
int restore_height_width = FALSE;
win_T *wp;
char_u *sname;
win_T *edited_win = NULL;
int tabnr;
int restore_stal = FALSE;
win_T *tab_firstwin;
frame_T *tab_topframe;
int cur_arg_idx = 0;
int next_arg_idx = 0;
int ret = FAIL;
tabpage_T *tp;
#ifdef FEAT_TERMINAL
hashtab_T terminal_bufs;
@@ -755,18 +756,11 @@ makeopens(
restore_stal = TRUE;
}
// May repeat putting Windows for each tab, when "tabpages" is in
// 'sessionoptions'.
// Don't use goto_tabpage(), it may change directory and trigger
// autocommands.
tab_firstwin = firstwin; // first window in tab page "tabnr"
tab_topframe = topframe;
if ((ssop_flags & SSOP_TABPAGES))
{
tabpage_T *tp;
// Similar to ses_win_rec() below, populate the tab pages first so
// later local options won't be copied to the new tabs.
// "tabpages" is in 'sessionoptions': Similar to ses_win_rec() below,
// populate the tab pages first so later local options won't be copied
// to the new tabs.
FOR_ALL_TABPAGES(tp)
// Use `bufhidden=wipe` to remove empty "placeholder" buffers once
// they are not needed. This prevents creating extra buffers (see
@@ -777,18 +771,20 @@ makeopens(
if (first_tabpage->tp_next != NULL && put_line(fd, "tabrewind") == FAIL)
goto fail;
}
for (tabnr = 1; ; ++tabnr)
// Assume "tabpages" is in 'sessionoptions'. If not then we only do
// "curtab" and bail out of the loop.
FOR_ALL_TABPAGES(tp)
{
tabpage_T *tp = NULL;
int need_tabnext = FALSE;
int cnr = 1;
// May repeat putting Windows for each tab, when "tabpages" is in
// 'sessionoptions'.
// Don't use goto_tabpage(), it may change directory and trigger
// autocommands.
if ((ssop_flags & SSOP_TABPAGES))
{
tp = find_tabpage(tabnr);
if (tp == NULL)
break; // done all tab pages
if (tp == curtab)
{
tab_firstwin = firstwin;
@@ -799,9 +795,15 @@ makeopens(
tab_firstwin = tp->tp_firstwin;
tab_topframe = tp->tp_topframe;
}
if (tabnr > 1)
if (tp != first_tabpage)
need_tabnext = TRUE;
}
else
{
tp = curtab;
tab_firstwin = firstwin;
tab_topframe = topframe;
}
// Before creating the window layout, try loading one file. If this
// is aborted we don't end up with a number of useless windows.
@@ -886,6 +888,7 @@ makeopens(
|| put_line(fd, "set winminwidth=0") == FAIL
|| put_line(fd, "set winwidth=1") == FAIL)
goto fail;
restore_height_width = TRUE;
}
if (nr > 1 && ses_winsizes(fd, restore_size, tab_firstwin) == FAIL)
goto fail;
@@ -893,11 +896,11 @@ makeopens(
// Restore the tab-local working directory if specified
// Do this before the windows, so that the window-local directory can
// override the tab-local directory.
if (tp != NULL && tp->tp_localdir != NULL && ssop_flags & SSOP_CURDIR)
if ((ssop_flags & SSOP_CURDIR) && tp->tp_localdir != NULL)
{
if (fputs("tcd ", fd) < 0
|| ses_put_fname(fd, tp->tp_localdir, &ssop_flags) == FAIL
|| put_eol(fd) == FAIL)
|| ses_put_fname(fd, tp->tp_localdir, &ssop_flags) == FAIL
|| put_eol(fd) == FAIL)
goto fail;
did_lcd = TRUE;
}
@@ -978,7 +981,7 @@ makeopens(
goto fail;
}
if (tab_firstwin->w_next != NULL)
if (restore_height_width)
{
// Restore 'winminheight' and 'winminwidth'.
if (put_line(fd, "let &winminheight = s:save_winminheight") == FAIL

View File

@@ -6760,27 +6760,34 @@ static int grey_ramp[] = {
0x80, 0x8A, 0x94, 0x9E, 0xA8, 0xB2, 0xBC, 0xC6, 0xD0, 0xDA, 0xE4, 0xEE
};
static char_u ansi_table[16][4] = {
// R G B idx
{ 0, 0, 0, 1}, // black
{224, 0, 0, 2}, // dark red
{ 0, 224, 0, 3}, // dark green
{224, 224, 0, 4}, // dark yellow / brown
{ 0, 0, 224, 5}, // dark blue
{224, 0, 224, 6}, // dark magenta
{ 0, 224, 224, 7}, // dark cyan
{224, 224, 224, 8}, // light grey
static char_u ansi_table[16][3] = {
// R G B
{ 0, 0, 0}, // black
{224, 0, 0}, // dark red
{ 0, 224, 0}, // dark green
{224, 224, 0}, // dark yellow / brown
{ 0, 0, 224}, // dark blue
{224, 0, 224}, // dark magenta
{ 0, 224, 224}, // dark cyan
{224, 224, 224}, // light grey
{128, 128, 128, 9}, // dark grey
{255, 64, 64, 10}, // light red
{ 64, 255, 64, 11}, // light green
{255, 255, 64, 12}, // yellow
{ 64, 64, 255, 13}, // light blue
{255, 64, 255, 14}, // light magenta
{ 64, 255, 255, 15}, // light cyan
{255, 255, 255, 16}, // white
{128, 128, 128}, // dark grey
{255, 64, 64}, // light red
{ 64, 255, 64}, // light green
{255, 255, 64}, // yellow
{ 64, 64, 255}, // light blue
{255, 64, 255}, // light magenta
{ 64, 255, 255}, // light cyan
{255, 255, 255}, // white
};
#if defined(MSWIN)
// Mapping between cterm indices < 16 and their counterpart in the ANSI palette.
static const char_u cterm_ansi_idx[] = {
0, 4, 2, 6, 1, 5, 3, 7, 8, 12, 10, 14, 9, 13, 11, 15
};
#endif
#define ANSI_INDEX_NONE 0
void
@@ -6790,10 +6797,15 @@ cterm_color2rgb(int nr, char_u *r, char_u *g, char_u *b, char_u *ansi_idx)
if (nr < 16)
{
*r = ansi_table[nr][0];
*g = ansi_table[nr][1];
*b = ansi_table[nr][2];
*ansi_idx = ansi_table[nr][3];
#if defined(MSWIN)
idx = cterm_ansi_idx[nr];
#else
idx = nr;
#endif
*r = ansi_table[idx][0];
*g = ansi_table[idx][1];
*b = ansi_table[idx][2];
*ansi_idx = idx + 1;
}
else if (nr < 232)
{

View File

@@ -82,7 +82,7 @@ endfunc
func Test_expand()
new
call assert_equal("''", expand('%:S'))
call assert_equal("", expand('%:S'))
call assert_equal('3', '<slnum>'->expand())
call assert_equal(['4'], expand('<slnum>', v:false, v:true))
" Don't add any line above this, otherwise <slnum> will change.
@@ -90,6 +90,7 @@ func Test_expand()
set verbose=1
call assert_equal("", expand('%'))
set verbose=0
call assert_equal("", expand('%:p'))
quit
endfunc

View File

@@ -211,6 +211,7 @@ let s:filename_checks = {
\ 'gitrebase': ['git-rebase-todo'],
\ 'gitsendemail': ['.gitsendemail.msg.xxxxxx'],
\ 'gkrellmrc': ['gkrellmrc', 'gkrellmrc_x'],
\ 'gleam': ['file.gleam'],
\ 'glsl': ['file.glsl'],
\ 'gnash': ['gnashrc', '.gnashrc', 'gnashpluginrc', '.gnashpluginrc'],
\ 'gnuplot': ['file.gpi', '.gnuplot'],
@@ -456,6 +457,7 @@ let s:filename_checks = {
\ 'rib': ['file.rib'],
\ 'rnc': ['file.rnc'],
\ 'rng': ['file.rng'],
\ 'robot': ['file.robot', 'file.resource'],
\ 'robots': ['robots.txt'],
\ 'routeros': ['file.rsc'],
\ 'rpcgen': ['file.x'],

View File

@@ -1560,4 +1560,10 @@ func Test_gui_findrepl()
bw!
endfunc
func Test_gui_CTRL_SHIFT_V()
call feedkeys(":let g:str = '\<*C-S-V>\<*C-S-I>\<*C-S-V>\<*C-S-@>'\<CR>", 'tx')
call assert_equal('<C-S-I><C-S-@>', g:str)
unlet g:str
endfunc
" vim: shiftwidth=2 sts=2 expandtab

View File

@@ -865,6 +865,34 @@ func Test_mksession_sesdir()
call delete('Xproj', 'rf')
endfunc
" Test for saving and restoring the tab-local working directory when there is
" only a single tab and 'tabpages' is not in 'sessionoptions'.
func Test_mksession_tcd_single_tabs()
only | tabonly
let save_cwd = getcwd()
set sessionoptions-=tabpages
set sessionoptions+=curdir
call mkdir('Xtopdir1')
call mkdir('Xtopdir2')
" There are two tab pages, the current one has local cwd set to 'Xtopdir2'.
exec 'tcd ' .. save_cwd .. '/Xtopdir1'
tabnew
exec 'tcd ' .. save_cwd .. '/Xtopdir2'
mksession! Xtest_tcd_single
source Xtest_tcd_single
call assert_equal(2, haslocaldir())
call assert_equal('Xtopdir2', fnamemodify(getcwd(-1, 0), ':t'))
%bwipe
set sessionoptions&
call chdir(save_cwd)
call delete('Xtopdir1', 'rf')
call delete('Xtopdir2', 'rf')
endfunc
" Test for storing the 'lines' and 'columns' settings
func Test_mksession_resize()
mksession! Xtest_mks1.out

View File

@@ -325,6 +325,21 @@ func Test_compl_vim_cmds_after_register_expr()
bwipe!
endfunc
func Test_compl_ignore_mappings()
call setline(1, ['foo', 'bar', 'baz', 'foobar'])
inoremap <C-P> (C-P)
inoremap <C-N> (C-N)
normal! G
call feedkeys("o\<C-X>\<C-N>\<C-N>\<C-N>\<C-P>\<C-N>\<C-Y>", 'tx')
call assert_equal('baz', getline('.'))
" Also test with unsimplified keys
call feedkeys("o\<C-X>\<*C-N>\<*C-N>\<*C-N>\<*C-P>\<*C-N>\<C-Y>", 'tx')
call assert_equal('baz', getline('.'))
iunmap <C-P>
iunmap <C-N>
bwipe!
endfunc
func DummyCompleteOne(findstart, base)
if a:findstart
return 0

View File

@@ -4115,6 +4115,38 @@ def Run_Test_misplaced_type()
delete('XTest_misplaced_type')
enddef
" Ensure echo doesn't crash when stringifying empty variables.
def Test_echo_uninit_variables()
var res: string
var var_bool: bool
var var_num: number
var var_float: float
var Var_func: func
var var_string: string
var var_blob: blob
var var_job: job
var var_channel: channel
var var_list: list<any>
var var_dict: dict<any>
redir => res
echo var_bool
echo var_num
echo var_float
echo Var_func
echo var_string
echo var_blob
echo var_job
echo var_channel
echo var_list
echo var_dict
redir END
assert_equal(['false', '0', '0.0', 'function()', '', '0z', 'no process',
'channel fail', '[]', '{}'], res->split('\n'))
enddef
" Keep this last, it messes up highlighting.
def Test_substitute_cmd()
new

View File

@@ -746,6 +746,38 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
4857,
/**/
4856,
/**/
4855,
/**/
4854,
/**/
4853,
/**/
4852,
/**/
4851,
/**/
4850,
/**/
4849,
/**/
4848,
/**/
4847,
/**/
4846,
/**/
4845,
/**/
4844,
/**/
4843,
/**/
4842,
/**/
4841,
/**/