summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-09-04 22:25:07 +0200
committerChristian Brabandt <cb@256bit.org>2023-09-04 22:25:07 +0200
commitdccc29c228f8336ef7dd069a447886639af4458e (patch)
tree407619ff91c36172c5fe25221a52905892a09061
parent3170342af3049852afb2fbca85df37baf5fec82f (diff)
patch 9.0.1866: undo is synced after character findv9.0.1866
Problem: Undo is synced after character find. Solution: Set no_u_sync when calling gotchars_nop(). closes: #13022 closes: #13024 Signed-off-by: Christian Brabandt <cb@256bit.org> Co-authored-by: zeertzjq <zeertzjq@outlook.com>
-rw-r--r--src/normal.c2
-rw-r--r--src/testdir/test_undo.vim10
-rw-r--r--src/version.c2
3 files changed, 14 insertions, 0 deletions
diff --git a/src/normal.c b/src/normal.c
index b73afd3212..86b8740f8a 100644
--- a/src/normal.c
+++ b/src/normal.c
@@ -570,7 +570,9 @@ normal_cmd_get_more_chars(
// but when replaying a recording the next key is already in the
// typeahead buffer, so record a <Nop> before that to prevent the
// vpeekc() above from applying wrong mappings when replaying.
+ ++no_u_sync;
gotchars_nop();
+ --no_u_sync;
}
}
--no_mapping;
diff --git a/src/testdir/test_undo.vim b/src/testdir/test_undo.vim
index 368ebbe916..58563bde63 100644
--- a/src/testdir/test_undo.vim
+++ b/src/testdir/test_undo.vim
@@ -862,5 +862,15 @@ func Test_undo_after_write()
call delete('Xtestfile.txt')
endfunc
+func Test_undo_range_normal()
+ new
+ call setline(1, ['asa', 'bsb'])
+ let &l:undolevels = &l:undolevels
+ %normal dfs
+ call assert_equal(['a', 'b'], getline(1, '$'))
+ undo
+ call assert_equal(['asa', 'bsb'], getline(1, '$'))
+ bwipe!
+endfunc
" vim: shiftwidth=2 sts=2 expandtab
diff --git a/src/version.c b/src/version.c
index c4b793f506..5eb9c59ab1 100644
--- a/src/version.c
+++ b/src/version.c
@@ -700,6 +700,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1866,
+/**/
1865,
/**/
1864,