aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/nvim/screen.c2
-rw-r--r--test/functional/ui/decorations_spec.lua63
-rw-r--r--test/functional/ui/diff_spec.lua26
3 files changed, 90 insertions, 1 deletions
diff --git a/src/nvim/screen.c b/src/nvim/screen.c
index 2ce2be0bfd..a3ec6e26a2 100644
--- a/src/nvim/screen.c
+++ b/src/nvim/screen.c
@@ -1692,7 +1692,7 @@ static void win_update(win_T *wp, Providers *providers)
if (eof) { // we hit the end of the file
wp->w_botline = buf->b_ml.ml_line_count + 1;
j = win_get_fill(wp, wp->w_botline);
- if (j > 0 && !wp->w_botfill) {
+ if (j > 0 && !wp->w_botfill && row < wp->w_grid.Rows) {
// Display filler text below last line. win_line() will check
// for ml_line_count+1 and only draw filler lines
foldinfo_T info = FOLDINFO_INIT;
diff --git a/test/functional/ui/decorations_spec.lua b/test/functional/ui/decorations_spec.lua
index dce6384b9b..1575cab591 100644
--- a/test/functional/ui/decorations_spec.lua
+++ b/test/functional/ui/decorations_spec.lua
@@ -1031,6 +1031,69 @@ if (h->n_buckets < new_n_buckets) { // expand
|
]]}
+ screen:try_resize(50, 11)
+ feed('gg')
+ screen:expect{grid=[[
+ ^if (h->n_buckets < new_n_buckets) { // expand |
+ khkey_t *new_keys = (khkey_t *)krealloc((void *)|
+ h->keys, new_n_buckets * sizeof(khkey_t)); |
+ h->keys = new_keys; |
+ if (kh_is_map && val_size) { |
+ char *new_vals = krealloc( h->vals_buf, new_n_|
+ buckets * val_size); |
+ h->vals_buf = new_vals; |
+ } |
+ } |
+ |
+ ]]}
+
+ feed('G<C-E>')
+ screen:expect{grid=[[
+ khkey_t *new_keys = (khkey_t *)krealloc((void *)|
+ h->keys, new_n_buckets * sizeof(khkey_t)); |
+ h->keys = new_keys; |
+ if (kh_is_map && val_size) { |
+ char *new_vals = krealloc( h->vals_buf, new_n_|
+ buckets * val_size); |
+ h->vals_buf = new_vals; |
+ } |
+ ^} |
+ Grugg |
+ |
+ ]]}
+
+ feed('gg')
+ screen:expect{grid=[[
+ ^if (h->n_buckets < new_n_buckets) { // expand |
+ khkey_t *new_keys = (khkey_t *)krealloc((void *)|
+ h->keys, new_n_buckets * sizeof(khkey_t)); |
+ h->keys = new_keys; |
+ if (kh_is_map && val_size) { |
+ char *new_vals = krealloc( h->vals_buf, new_n_|
+ buckets * val_size); |
+ h->vals_buf = new_vals; |
+ } |
+ } |
+ |
+ ]]}
+
+ screen:try_resize(50, 12)
+ feed('G')
+ screen:expect{grid=[[
+ if (h->n_buckets < new_n_buckets) { // expand |
+ khkey_t *new_keys = (khkey_t *)krealloc((void *)|
+ h->keys, new_n_buckets * sizeof(khkey_t)); |
+ h->keys = new_keys; |
+ if (kh_is_map && val_size) { |
+ char *new_vals = krealloc( h->vals_buf, new_n_|
+ buckets * val_size); |
+ h->vals_buf = new_vals; |
+ } |
+ ^} |
+ Grugg |
+ |
+ ]]}
+
meths.buf_del_extmark(0, ns, id)
screen:expect{grid=[[
if (h->n_buckets < new_n_buckets) { // expand |
diff --git a/test/functional/ui/diff_spec.lua b/test/functional/ui/diff_spec.lua
index 13949b0756..bd2692d19a 100644
--- a/test/functional/ui/diff_spec.lua
+++ b/test/functional/ui/diff_spec.lua
@@ -186,6 +186,19 @@ describe('Diff mode screen', function()
{7:<onal-diff-screen-1 }{3:<l-diff-screen-1.2 }|
:set diffopt+=internal |
]])
+
+ screen:try_resize(40, 9)
+ screen:expect([[
+ {1:+ }{5:^+-- 4 lines: 1···}{3:│}{1:+ }{5:+-- 4 lines: 1··}|
+ {1: }5 {3:│}{1: }5 |
+ {1: }6 {3:│}{1: }6 |
+ {1: }7 {3:│}{1: }7 |
+ {1: }8 {3:│}{1: }8 |
+ {1: }9 {3:│}{1: }9 |
+ {1: }10 {3:│}{1: }10 |
+ {7:<onal-diff-screen-1 }{3:<l-diff-screen-1.2 }|
+ |
+ ]])
end)
it('Add a line at the end of file 1', function()
@@ -232,6 +245,19 @@ describe('Diff mode screen', function()
{7:<onal-diff-screen-1 }{3:<l-diff-screen-1.2 }|
:set diffopt+=internal |
]])
+
+ screen:try_resize(40, 9)
+ screen:expect([[
+ {1:+ }{5:^+-- 4 lines: 1···}{3:│}{1:+ }{5:+-- 4 lines: 1··}|
+ {1: }5 {3:│}{1: }5 |
+ {1: }6 {3:│}{1: }6 |
+ {1: }7 {3:│}{1: }7 |
+ {1: }8 {3:│}{1: }8 |
+ {1: }9 {3:│}{1: }9 |
+ {1: }10 {3:│}{1: }10 |
+ {7:<onal-diff-screen-1 }{3:<l-diff-screen-1.2 }|
+ |
+ ]])
end)
it('Add a line in the middle of file 2, remove on at the end of file 1', function()