wlv.draw_state = WL_CMDLINE;
if (wp == cmdwin_win)
{
- // Draw the cmdline character.
wlv.n_extra = 1;
- wlv.c_extra = cmdwin_type;
wlv.c_final = NUL;
- wlv.char_attr =
- hl_combine_attr(get_win_attr(wp), HL_ATTR(HLF_AT));
+ if (wlv.row == wlv.startrow)
+ {
+ wlv.c_extra = cmdwin_type;
+ wlv.char_attr = hl_combine_attr(
+ get_win_attr(wp), HL_ATTR(HLF_AT));
+ }
+ else
+ {
+ wlv.c_extra = ' ';
+ wlv.char_attr = get_win_attr(wp);
+ }
}
}
#ifdef FEAT_FOLDING
exmode_active = 0;
State = MODE_NORMAL;
+ check_cursor();
setmouse();
clear_showcmd();
--- /dev/null
+| +0&#ffffff0@39
+|~+0#4040ff13&| @38
+|[+1#0000000&|N|o| |N|a|m|e|]| @12|0|,|0|-|1| @9|A|l@1
+|:+0#4040ff13&|e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|a@31|"
+| +0#0000000&|X|Y>Z| @35
+|~+0#4040ff13&| @38
+|~| @38
+|~| @38
+|~| @38
+|~| @38
+|[+3#0000000&|C|o|m@1|a|n|d| |L|i|n|e|]| @7|1|,|4|2| @10|A|l@1
+| +0&&@39
|:+0#4040ff13&|s+0#af5f00255&|e|t| +0#0000000&|w+0#e000e06&|i|l|d|m|o|d|e|=+0#af5f00255&|l+0#0000000&|o|n|g|e|s|t|,+0#e000e06&|f+0#0000000&|u|l@1| @48
|:+0#4040ff13&|s+0#af5f00255&|e|t| +0#0000000&|w+0#e000e06&|i|l|d|m|o|d|e|=+0#af5f00255&|f+0#0000000&|u|l@1| @56
|:+0#4040ff13&|s+0#af5f00255&|i|g|n| +0#0000000&|d|e|f|i|n|e| @62
-|:+0#4040ff13&|s+0#af5f00255&|i|g|n| +0#0000000&|d|e|f|i|n|e> @62
+|:+0#4040ff13&|s+0#af5f00255&|i|g|n| +0#0000000&|d|e|f|i|n>e| @62
|~+0#4040ff13&| @73
|~| @73
|[+3#0000000&|C|o|m@1|a|n|d| |L|i|n|e|]| @60
" When the popup is open, entering the cmdline window should close the popup
call term_sendkeys(buf, "\<C-U>sign \<Tab>\<C-F>")
- call WaitForTermCurPosAndLinesToMatch(buf, [6, (strlen(':sign define') + 1)], g:test_timeout, (rows, '^You discovered the command-line window! You can close it with ":q"\.'))
+ call WaitForTermCurPosAndLinesToMatch(buf, [6, strlen(':sign define')], g:test_timeout, (rows, '^You discovered the command-line window! You can close it with ":q"\.'))
call WaitFor({buf_ -> {-> term_scrape(buf, 6)->slice(1, 5)->filter({_, v -> v.fg == '#af5f00'})->len() == 4}}(buf), g:test_timeout)
call VerifyScreenDump(buf, 'Test_wildmenu_pum_22', {})
call term_sendkeys(buf, ":q\<CR>")
call StopVimInTerminal(buf)
endfunc
+func Test_cmdwin_cursor_position()
+ " When the cmdline fills the screen width exactly, pressing CTRL-F to open
+ " the cmdwin should place the cursor on the last character, not past it.
+ let cmd = 'echo "' .. repeat('a', &columns - 8) .. '"'
+ call assert_equal(&columns - 1, len(cmd))
+ let g:cmdwin_col = 0
+ let g:cmdwin_line = ''
+ call feedkeys(':' .. cmd .. "\<C-F>" ..
+ \ ":let g:cmdwin_col = col('.')\<CR>" ..
+ \ ":let g:cmdwin_line = getline('.')\<CR>" ..
+ \ ":q\<CR>", 'x!')
+ call assert_equal(len(cmd), g:cmdwin_col)
+ call assert_equal(cmd, g:cmdwin_line)
+ unlet g:cmdwin_col g:cmdwin_line
+endfunc
+
+func Test_cmdwin_no_prefix_on_wrapped_line()
+ CheckScreendump
+
+ let lines =<< trim END
+ augroup vimHints | au! | augroup END
+ END
+ call writefile(lines, 'Xcmdwin_wrap', 'D')
+
+ let buf = RunVimInTerminal('-S Xcmdwin_wrap', #{rows: 12, cols: 40})
+ let cmd = 'echo "' .. repeat('a', 40 - 8) .. '"XYZ'
+ call term_sendkeys(buf, ':' .. cmd .. "\<C-F>")
+ call TermWait(buf, 100)
+ call VerifyScreenDump(buf, 'Test_cmdwin_wrap_prefix', {})
+
+ call term_sendkeys(buf, ":q\<CR>")
+ call StopVimInTerminal(buf)
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 346,
/**/
345,
/**/