diff options
author | watiko <service@mail.watiko.net> | 2016-02-23 01:15:57 +0900 |
---|---|---|
committer | watiko <service@mail.watiko.net> | 2016-02-23 01:19:10 +0900 |
commit | 63606bb4099c3df049a24fd31907553682e6fd09 (patch) | |
tree | 9df5123b1471395770335098aea69ab44700b380 /src | |
parent | faf828b476cd1cb6668a8de458d2f25eafb650e6 (diff) | |
download | rneovim-63606bb4099c3df049a24fd31907553682e6fd09.tar.gz rneovim-63606bb4099c3df049a24fd31907553682e6fd09.tar.bz2 rneovim-63606bb4099c3df049a24fd31907553682e6fd09.zip |
vim-patch:7.4.961
Problem: Test107 fails in some circunstances.
Solution: When using "zt", "zb" and "z=" recompute the fraction.
https://github.com/vim/vim/commit/9dc2ce398bb3456cc8f590ef0260459798b34d2a
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/normal.c | 3 | ||||
-rw-r--r-- | src/nvim/version.c | 2 | ||||
-rw-r--r-- | src/nvim/window.c | 6 |
3 files changed, 6 insertions, 5 deletions
diff --git a/src/nvim/normal.c b/src/nvim/normal.c index e064d34e09..9ee7a97270 100644 --- a/src/nvim/normal.c +++ b/src/nvim/normal.c @@ -4096,6 +4096,7 @@ dozet: case 't': scroll_cursor_top(0, true); redraw_later(VALID); + set_fraction(curwin); break; /* "z." and "zz": put cursor in middle of screen */ @@ -4104,6 +4105,7 @@ dozet: case 'z': scroll_cursor_halfway(true); redraw_later(VALID); + set_fraction(curwin); break; /* "z^", "z-" and "zb": put cursor at bottom of screen */ @@ -4124,6 +4126,7 @@ dozet: case 'b': scroll_cursor_bot(0, true); redraw_later(VALID); + set_fraction(curwin); break; /* "zH" - scroll screen right half-page */ diff --git a/src/nvim/version.c b/src/nvim/version.c index 80b1b236dd..cd31143be7 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -329,7 +329,7 @@ static int included_patches[] = { // 964 NA 963, // 962 NA - // 961, + 961, // 960 NA // 959 NA // 958, diff --git a/src/nvim/window.c b/src/nvim/window.c index 39106a7b8d..4a2912d724 100644 --- a/src/nvim/window.c +++ b/src/nvim/window.c @@ -4619,10 +4619,8 @@ void win_drag_vsep_line(win_T *dragwin, int offset) #define FRACTION_MULT 16384L -/* - * Set wp->w_fraction for the current w_wrow and w_height. - */ -static void set_fraction(win_T *wp) +// Set wp->w_fraction for the current w_wrow and w_height. +void set_fraction(win_T *wp) { wp->w_fraction = ((long)wp->w_wrow * FRACTION_MULT + wp->w_height / 2) / (long)wp->w_height; |