aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndré Twupack <atwupack@mailbox.org>2014-09-22 20:46:28 +0200
committerAndré Twupack <atwupack@mailbox.org>2014-09-22 20:46:28 +0200
commit57d497c51b1159052cb53c9e4db0388626b35903 (patch)
treee6820e68dd1a78991031fdeae7744c5d5cf0e4bc /src
parent1c84a0e09093d728408024a6baa9967df596be54 (diff)
downloadrneovim-57d497c51b1159052cb53c9e4db0388626b35903.tar.gz
rneovim-57d497c51b1159052cb53c9e4db0388626b35903.tar.bz2
rneovim-57d497c51b1159052cb53c9e4db0388626b35903.zip
vim-patch:7.4.386
Problem: When splitting a window the changelist position is wrong. Solution: Copy the changelist position. (Jacob Niehus) https://code.google.com/p/vim/source/detail?r=v7-4-386
Diffstat (limited to 'src')
-rw-r--r--src/nvim/testdir/Makefile1
-rw-r--r--src/nvim/testdir/test_changelist.in22
-rw-r--r--src/nvim/testdir/test_changelist.ok1
-rw-r--r--src/nvim/version.c2
-rw-r--r--src/nvim/window.c3
5 files changed, 28 insertions, 1 deletions
diff --git a/src/nvim/testdir/Makefile b/src/nvim/testdir/Makefile
index 81dc49e800..9f04f880b5 100644
--- a/src/nvim/testdir/Makefile
+++ b/src/nvim/testdir/Makefile
@@ -33,6 +33,7 @@ SCRIPTS := test_autoformat_join.out \
test106.out test107.out \
test_options.out \
test_listlbr.out test_listlbr_utf8.out \
+ test_changelist.out \
test_breakindent.out \
test_insertcount.out
diff --git a/src/nvim/testdir/test_changelist.in b/src/nvim/testdir/test_changelist.in
new file mode 100644
index 0000000000..6c7c4306c3
--- /dev/null
+++ b/src/nvim/testdir/test_changelist.in
@@ -0,0 +1,22 @@
+Test changelist position after splitting window
+Set 'undolevels' to make changelist for sourced file
+
+STARTTEST
+:so small.vim
+Gkylp:set ul=100
+Gylp:set ul=100
+gg
+:vsplit
+:try
+: normal g;
+: normal ggVGcpass
+:catch
+: normal ggVGcfail
+:finally
+: %w! test.out
+:endtry
+:qa!
+ENDTEST
+
+1
+2
diff --git a/src/nvim/testdir/test_changelist.ok b/src/nvim/testdir/test_changelist.ok
new file mode 100644
index 0000000000..2ae28399f5
--- /dev/null
+++ b/src/nvim/testdir/test_changelist.ok
@@ -0,0 +1 @@
+pass
diff --git a/src/nvim/version.c b/src/nvim/version.c
index 5a0b01df28..51012bd69f 100644
--- a/src/nvim/version.c
+++ b/src/nvim/version.c
@@ -242,7 +242,7 @@ static int included_patches[] = {
//389,
388,
387,
- //386,
+ 386,
//385,
//384 NA
383,
diff --git a/src/nvim/window.c b/src/nvim/window.c
index ebce53cdf4..5ed145573d 100644
--- a/src/nvim/window.c
+++ b/src/nvim/window.c
@@ -948,6 +948,9 @@ int win_split_ins(int size, int flags, win_T *new_wp, int dir)
p_wh = size;
}
+ // Keep same changelist position in new window.
+ wp->w_changelistidx = oldwin->w_changelistidx;
+
/*
* make the new window the current window
*/