patch 9.0.1866: undo is synced after character find

Commit: 
https://github.com/vim/vim/commit/dccc29c228f8336ef7dd069a447886639af4458e
Author: zeertzjq <[email protected]>
Date:   Mon Sep 4 22:25:07 2023 +0200

    patch 9.0.1866: undo is synced after character find
    
    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 <[email protected]>
    Co-authored-by: zeertzjq <[email protected]>

diff --git a/src/normal.c b/src/normal.c
index b73afd321..86b8740f8 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 368ebbe91..58563bde6 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 c4b793f50..5eb9c59ab 100644
--- a/src/version.c
+++ b/src/version.c
@@ -699,6 +699,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1866,
 /**/
     1865,
 /**/

-- 
-- 
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 on the web visit 
https://groups.google.com/d/msgid/vim_dev/E1qdGD1-00FSM7-7x%40256bit.org.

Raspunde prin e-mail lui