summaryrefslogtreecommitdiffstats
path: root/src/evalbuffer.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-10-20 21:14:19 +0100
committerBram Moolenaar <Bram@vim.org>2022-10-20 21:14:19 +0100
commit63c84731c1802bac36c1d1a82b3ef5960b35b089 (patch)
tree0058a583b4bd00d530a8fc1a46204fc5094eeebd /src/evalbuffer.c
parent6c8bc37a1083d17447156592f6f52da2d40b4855 (diff)
patch 9.0.0809: test for job writing to buffer failsv9.0.0809
Problem: Test for job writing to buffer fails. Solution: Correct w_topline when deleting a buffer line.
Diffstat (limited to 'src/evalbuffer.c')
-rw-r--r--src/evalbuffer.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/evalbuffer.c b/src/evalbuffer.c
index 3527737b92..e77435b8f4 100644
--- a/src/evalbuffer.c
+++ b/src/evalbuffer.c
@@ -571,10 +571,13 @@ f_deletebufline(typval_T *argvars, typval_T *rettv)
{
if (wp->w_cursor.lnum > last)
wp->w_cursor.lnum -= count;
- else if (wp->w_cursor.lnum> first)
+ else if (wp->w_cursor.lnum > first)
wp->w_cursor.lnum = first;
if (wp->w_cursor.lnum > wp->w_buffer->b_ml.ml_line_count)
wp->w_cursor.lnum = wp->w_buffer->b_ml.ml_line_count;
+ wp->w_valid = 0;
+ if (wp->w_cursor.lnum <= wp->w_topline)
+ wp->w_topline = 1;
}
check_cursor_col();
deleted_lines_mark(first, count);