aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/nvim/edit.c3
-rw-r--r--test/old/testdir/test_cmdwin.vim8
2 files changed, 10 insertions, 1 deletions
diff --git a/src/nvim/edit.c b/src/nvim/edit.c
index 7670d6754f..e3321a8b99 100644
--- a/src/nvim/edit.c
+++ b/src/nvim/edit.c
@@ -1528,8 +1528,9 @@ void edit_unputchar(void)
// Called when p_dollar is set: display a '$' at the end of the changed text
// Only works when cursor is in the line that changes.
-void display_dollar(colnr_T col)
+void display_dollar(colnr_T col_arg)
{
+ colnr_T col = col_arg < 0 ? 0 : col_arg;
colnr_T save_col;
if (!redrawing()) {
diff --git a/test/old/testdir/test_cmdwin.vim b/test/old/testdir/test_cmdwin.vim
index ef334c774f..14170fbb13 100644
--- a/test/old/testdir/test_cmdwin.vim
+++ b/test/old/testdir/test_cmdwin.vim
@@ -13,5 +13,13 @@ func Test_cant_open_cmdwin_in_cmdwin()
call assert_match('E1292:', caught)
endfunc
+func Test_cmdwin_virtual_edit()
+ enew!
+ set ve=all cpo+=$
+ silent normal q/s
+
+ set ve= cpo-=$
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab