mirror of
https://github.com/vim/vim.git
synced 2026-05-28 00:21:37 +02:00
patch 9.2.0423: popup: wrapped cmdline truncated with wildoptions=pum
Problem: popup: wrapped cmdline truncated with wildoptions=pum
Solution: Call msg_starthere() in redrawcmd() to reset lines_left
before each redraw (Yasuhiro Matsumoto).
redrawcmd() leaves lines_left at its previous value, which decrements
across successive redraws (e.g. when wildtrigger() refreshes the popup
on every keystroke) until 0, after which msg_no_more aborts drawing
the wrapped cmdline. Call msg_starthere() to reset it.
related: #20081
Signed-off-by: Yasuhiro Matsumoto <mattn.jp@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
committed by
Christian Brabandt
parent
ba85f88fe9
commit
587447ec64
@@ -4122,6 +4122,8 @@ redrawcmd(void)
|
||||
|
||||
sb_text_restart_cmdline();
|
||||
msg_start();
|
||||
// Reset lines_left so a wrapped cmdline isn't truncated by msg_no_more.
|
||||
msg_starthere();
|
||||
redrawcmdprompt();
|
||||
|
||||
// Don't use more prompt, truncate the cmdline if it doesn't fit.
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
|~+0#4040ff13#ffffff0| @28
|
||||
|~| @28
|
||||
|~| @28
|
||||
|~| @28
|
||||
|~| @28
|
||||
|~| @28
|
||||
|:+0#0000000&|e| |x@26
|
||||
@13> @16
|
||||
@@ -5249,6 +5249,32 @@ func Test_wildtrigger_update_screen()
|
||||
call StopVimInTerminal(buf)
|
||||
endfunc
|
||||
|
||||
" Wrapped cmdline must not be truncated when wildtrigger() redraws on every
|
||||
" keystroke.
|
||||
func Test_wildtrigger_wrapped_cmdline()
|
||||
CheckScreendump
|
||||
|
||||
let lines =<< trim [SCRIPT]
|
||||
set wildmenu wildmode=noselect:lastused,full wildoptions=pum
|
||||
cnoremap <F8> <C-R>=wildtrigger()[-1]<CR>
|
||||
[SCRIPT]
|
||||
call writefile(lines, 'XTest_wildtrigger_wrap', 'D')
|
||||
let rows = 8
|
||||
let cols = 30
|
||||
let buf = RunVimInTerminal('-S XTest_wildtrigger_wrap', {'rows': rows, 'cols': cols})
|
||||
|
||||
call term_sendkeys(buf, ":e ")
|
||||
for i in range(40)
|
||||
call term_sendkeys(buf, "x\<F8>")
|
||||
endfor
|
||||
|
||||
call WaitForTermCurPosAndLinesToMatch(buf, [rows, ((3 + 40) - cols + 1)])
|
||||
call VerifyScreenDump(buf, 'Test_wildtrigger_wrapped_cmdline_1', {})
|
||||
|
||||
call term_sendkeys(buf, "\<Esc>")
|
||||
call StopVimInTerminal(buf)
|
||||
endfunc
|
||||
|
||||
" Issue #17969: With 'noselect', the popup menu should appear next to the
|
||||
" environment variable being expanded. Disable 'showtail' when completing
|
||||
" file paths when 'noselect' is present.
|
||||
|
||||
@@ -729,6 +729,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
423,
|
||||
/**/
|
||||
422,
|
||||
/**/
|
||||
|
||||
Reference in New Issue
Block a user