]> granicus.if.org Git - vim/commitdiff
patch 9.0.0809: test for job writing to buffer fails v9.0.0809
authorBram Moolenaar <Bram@vim.org>
Thu, 20 Oct 2022 20:14:19 +0000 (21:14 +0100)
committerBram Moolenaar <Bram@vim.org>
Thu, 20 Oct 2022 20:14:19 +0000 (21:14 +0100)
Problem:    Test for job writing to buffer fails.
Solution:   Correct w_topline when deleting a buffer line.

src/evalbuffer.c
src/version.c

index 3527737b9293d6b49dedaa601a8a407e9af15d1f..e77435b8f407dc1616422c71cf649676e3ca16bd 100644 (file)
@@ -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);
index 21ff6c2fd9e3b2898547499c640bc752d22db21e..94e5d5c95bbd5494385b99bedd23add36b072d7a 100644 (file)
@@ -695,6 +695,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    809,
 /**/
     808,
 /**/