patch 9.2.0621: 'autoindent' not stripped with virtualedit=onemore
Commit:
https://github.com/vim/vim/commit/4b13277edd935b78a20a0d679802a1cb789abfcf
Author: zeertzjq <[email protected]>
Date: Fri Jun 12 09:32:10 2026 +0000
patch 9.2.0621: 'autoindent' not stripped with virtualedit=onemore
Problem: 'autoindent' not stripped with virtualedit=onemore (after
9.2.0510).
Solution: Restore the decrement of cursor column when it's on NUL.
fixes: neovim/neovim#40183
closes: #20476
Signed-off-by: zeertzjq <[email protected]>
Signed-off-by: glepnir <[email protected]>
Signed-off-by: Christian Brabandt <[email protected]>
diff --git a/src/edit.c b/src/edit.c
index 3eba12dab..c10654e36 100644
--- a/src/edit.c
+++ b/src/edit.c
@@ -2670,6 +2670,8 @@ stop_insert(
curwin->w_cursor.col = strip_col;
for (;;)
{
+ if (gchar_cursor() == NUL && curwin->w_cursor.col > 0)
+ --curwin->w_cursor.col;
cc = gchar_cursor();
if (!VIM_ISWHITE(cc))
break;
diff --git a/src/testdir/test_virtualedit.vim b/src/testdir/test_virtualedit.vim
index 902bbbfd1..24a190303 100644
--- a/src/testdir/test_virtualedit.vim
+++ b/src/testdir/test_virtualedit.vim
@@ -788,4 +788,18 @@ func Test_set_virtualedit_on_mode_change()
bwipe!
endfunc
+func Test_strip_autoindent_with_virtualedit_onemore()
+ new
+ setlocal autoindent virtualedit=onemore
+ call feedkeys("i x\<CR>\<Esc>", 'tnix')
+ call assert_equal([' x', ''], getline(1, '$'))
+
+ %delete _
+ setlocal virtualedit&
+ call feedkeys("i x\<CR>\<Esc>", 'tnix')
+ call assert_equal([' x', ''], getline(1, '$'))
+
+ bwipe!
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab
diff --git a/src/version.c b/src/version.c
index 8538d4ed3..fac15c00f 100644
--- a/src/version.c
+++ b/src/version.c
@@ -754,6 +754,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 621,
/**/
620,
/**/
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/vim_dev/E1wXyRk-00B5wU-8s%40256bit.org.