mirror of
https://github.com/neovim/neovim.git
synced 2025-09-28 14:08:32 +00:00
vim-patch:7.4.634
Problem: Marks are not restored after redo + undo. Solution: Fix the way marks are restored. (Olaf Dabrunz)f65aad5554
35e7594dd4
This commit is contained in:
@@ -28,6 +28,7 @@ SCRIPTS := \
|
||||
test_charsearch.out \
|
||||
test_close_count.out \
|
||||
test_command_count.out \
|
||||
test_marks.out \
|
||||
|
||||
NEW_TESTS = test_increment.res
|
||||
|
||||
|
18
src/nvim/testdir/test_marks.in
Normal file
18
src/nvim/testdir/test_marks.in
Normal file
@@ -0,0 +1,18 @@
|
||||
Tests for marks.
|
||||
|
||||
STARTTEST
|
||||
:so small.vim
|
||||
:" test that a deleted mark is restored after delete-undo-redo-undo
|
||||
:/^\t/+1
|
||||
:set nocp viminfo+=nviminfo
|
||||
madduu
|
||||
:let a = string(getpos("'a"))
|
||||
:$put ='Mark after delete-undo-redo-undo: '.a
|
||||
:/^\t/,$wq! test.out
|
||||
ENDTEST
|
||||
|
||||
textline A
|
||||
textline B
|
||||
textline C
|
||||
|
||||
Results:
|
6
src/nvim/testdir/test_marks.ok
Normal file
6
src/nvim/testdir/test_marks.ok
Normal file
@@ -0,0 +1,6 @@
|
||||
textline A
|
||||
textline B
|
||||
textline C
|
||||
|
||||
Results:
|
||||
Mark after delete-undo-redo-undo: [0, 15, 2, 0]
|
@@ -2222,11 +2222,16 @@ static void u_undoredo(int undo)
|
||||
/*
|
||||
* restore marks from before undo/redo
|
||||
*/
|
||||
for (i = 0; i < NMARKS; ++i)
|
||||
for (i = 0; i < NMARKS; ++i) {
|
||||
if (curhead->uh_namedm[i].mark.lnum != 0) {
|
||||
free_fmark(curbuf->b_namedm[i]);
|
||||
curbuf->b_namedm[i] = curhead->uh_namedm[i];
|
||||
}
|
||||
if (namedm[i].mark.lnum != 0) {
|
||||
curhead->uh_namedm[i] = namedm[i];
|
||||
} else {
|
||||
curhead->uh_namedm[i].mark.lnum = 0;
|
||||
}
|
||||
}
|
||||
if (curhead->uh_visual.vi_start.lnum != 0) {
|
||||
curbuf->b_visual = curhead->uh_visual;
|
||||
|
@@ -523,7 +523,7 @@ static int included_patches[] = {
|
||||
637,
|
||||
636,
|
||||
635,
|
||||
// 634,
|
||||
634,
|
||||
633,
|
||||
// 632 NA
|
||||
631,
|
||||
|
Reference in New Issue
Block a user