aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorlonerover <pathfinder1644@yahoo.com>2017-02-07 15:46:19 +0800
committerlonerover <pathfinder1644@yahoo.com>2017-02-07 15:47:28 +0800
commit7629176fb11be234882c64e3bf92d97839301fe4 (patch)
treed6dd072d65f1d231b2c6a976eeaa38cb260992f6 /src
parentcca8d2751a238b7f64eec80fc74e786d358642ce (diff)
downloadrneovim-7629176fb11be234882c64e3bf92d97839301fe4.tar.gz
rneovim-7629176fb11be234882c64e3bf92d97839301fe4.tar.bz2
rneovim-7629176fb11be234882c64e3bf92d97839301fe4.zip
vim-patch:7.4.2275
Problem: ":diffoff!" does not remove filler lines. Solution: Force a redraw and invalidate the cursor. (closes vim/vim#1014) https://github.com/vim/vim/commit/e67d546f3c691139e6d3d33f36724d98aec04c14
Diffstat (limited to 'src')
-rw-r--r--src/nvim/diff.c9
-rw-r--r--src/nvim/testdir/test_diffmode.vim16
-rw-r--r--src/nvim/version.c2
3 files changed, 23 insertions, 4 deletions
diff --git a/src/nvim/diff.c b/src/nvim/diff.c
index aafd50687e..9cb0789400 100644
--- a/src/nvim/diff.c
+++ b/src/nvim/diff.c
@@ -1154,10 +1154,13 @@ void ex_diffoff(exarg_T *eap)
}
foldUpdateAll(wp);
-
- // make sure topline is not halfway through a fold
- changed_window_setting_win(wp);
}
+ // remove filler lines
+ wp->w_topfill = 0;
+
+ // make sure topline is not halfway a fold and cursor is
+ // invalidated
+ changed_window_setting_win(wp);
// Note: 'sbo' is not restored, it's a global option.
diff_buf_adjust(wp);
diff --git a/src/nvim/testdir/test_diffmode.vim b/src/nvim/testdir/test_diffmode.vim
index 7666594862..5de394de8e 100644
--- a/src/nvim/testdir/test_diffmode.vim
+++ b/src/nvim/testdir/test_diffmode.vim
@@ -202,3 +202,19 @@ func Test_diffget_diffput()
bwipe!
enew!
endfunc
+
+func Test_diffoff()
+ enew!
+ call setline(1, ['Two', 'Three'])
+ let normattr = screenattr(1, 1)
+ diffthis
+ botright vert new
+ call setline(1, ['One', '', 'Two', 'Three'])
+ diffthis
+ redraw
+ diffoff!
+ redraw
+ call assert_equal(normattr, screenattr(1, 1))
+ bwipe!
+ bwipe!
+endfunc
diff --git a/src/nvim/version.c b/src/nvim/version.c
index e73b68b6e7..befcc918cc 100644
--- a/src/nvim/version.c
+++ b/src/nvim/version.c
@@ -165,7 +165,7 @@ static int included_patches[] = {
// 2278 NA
2277,
// 2276,
- // 2275,
+ 2275,
2274,
2273,
2272,