mirror of
https://github.com/neovim/neovim.git
synced 2025-10-14 13:56:05 +00:00
vim-patch:9.1.1338: Calling expand() interferes with cmdcomplete_info()
Problem: Calling expand() interferes with cmdcomplete_info()
(after 9.1.1329).
Solution: Only clear cmdline_orig when starting/ending cmdline mode
(zeertzjq).
closes: vim/vim#17192
ec270a5f55
This commit is contained in:
@@ -970,7 +970,6 @@ void ExpandInit(expand_T *xp)
|
|||||||
xp->xp_backslash = XP_BS_NONE;
|
xp->xp_backslash = XP_BS_NONE;
|
||||||
xp->xp_prefix = XP_PREFIX_NONE;
|
xp->xp_prefix = XP_PREFIX_NONE;
|
||||||
xp->xp_numfiles = -1;
|
xp->xp_numfiles = -1;
|
||||||
XFREE_CLEAR(cmdline_orig);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Cleanup an expand structure after use.
|
/// Cleanup an expand structure after use.
|
||||||
@@ -983,6 +982,11 @@ void ExpandCleanup(expand_T *xp)
|
|||||||
XFREE_CLEAR(xp->xp_orig);
|
XFREE_CLEAR(xp->xp_orig);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void clear_cmdline_orig(void)
|
||||||
|
{
|
||||||
|
XFREE_CLEAR(cmdline_orig);
|
||||||
|
}
|
||||||
|
|
||||||
/// Display one line of completion matches. Multiple matches are displayed in
|
/// Display one line of completion matches. Multiple matches are displayed in
|
||||||
/// each line (used by wildmode=list and CTRL-D)
|
/// each line (used by wildmode=list and CTRL-D)
|
||||||
///
|
///
|
||||||
|
@@ -745,6 +745,7 @@ static uint8_t *command_line_enter(int firstc, int count, int indent, bool clear
|
|||||||
|
|
||||||
ExpandInit(&s->xpc);
|
ExpandInit(&s->xpc);
|
||||||
ccline.xpc = &s->xpc;
|
ccline.xpc = &s->xpc;
|
||||||
|
clear_cmdline_orig();
|
||||||
|
|
||||||
cmdmsg_rl = (curwin->w_p_rl && *curwin->w_p_rlc == 's'
|
cmdmsg_rl = (curwin->w_p_rl && *curwin->w_p_rlc == 's'
|
||||||
&& (s->firstc == '/' || s->firstc == '?'));
|
&& (s->firstc == '/' || s->firstc == '?'));
|
||||||
@@ -901,6 +902,7 @@ static uint8_t *command_line_enter(int firstc, int count, int indent, bool clear
|
|||||||
|
|
||||||
ExpandCleanup(&s->xpc);
|
ExpandCleanup(&s->xpc);
|
||||||
ccline.xpc = NULL;
|
ccline.xpc = NULL;
|
||||||
|
clear_cmdline_orig();
|
||||||
|
|
||||||
finish_incsearch_highlighting(s->gotesc, &s->is_state, false);
|
finish_incsearch_highlighting(s->gotesc, &s->is_state, false);
|
||||||
|
|
||||||
|
@@ -4287,10 +4287,12 @@ func Test_cd_bslash_completion_windows()
|
|||||||
let &shellslash = save_shellslash
|
let &shellslash = save_shellslash
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
" Testg cmdcomplete_info() with CmdlineLeavePre autocmd
|
" Test cmdcomplete_info() with CmdlineLeavePre autocmd
|
||||||
func Test_cmdcomplete_info()
|
func Test_cmdcomplete_info()
|
||||||
augroup test_CmdlineLeavePre
|
augroup test_CmdlineLeavePre
|
||||||
autocmd!
|
autocmd!
|
||||||
|
" Calling expand() should not interfere with cmdcomplete_info().
|
||||||
|
autocmd CmdlineLeavePre * call expand('test_cmdline.*')
|
||||||
autocmd CmdlineLeavePre * let g:cmdcomplete_info = string(cmdcomplete_info())
|
autocmd CmdlineLeavePre * let g:cmdcomplete_info = string(cmdcomplete_info())
|
||||||
augroup END
|
augroup END
|
||||||
new
|
new
|
||||||
|
Reference in New Issue
Block a user