To: vim_dev@googlegroups.com Subject: Patch 8.2.2860 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.2860 Problem: Adding a text property causes the whole window to be redawn. Solution: Use changed_lines_buf() to only redraw the affected lines. Files: src/change.c, src/proto/change.pro, src/textprop.c *** ../vim-8.2.2859/src/change.c 2020-10-28 20:19:56.368057090 +0100 --- src/change.c 2021-05-16 20:17:16.545959259 +0200 *************** *** 758,764 **** /* * Marks the area to be redrawn after a change. */ ! static void changed_lines_buf( buf_T *buf, linenr_T lnum, // first line with change --- 758,764 ---- /* * Marks the area to be redrawn after a change. */ ! void changed_lines_buf( buf_T *buf, linenr_T lnum, // first line with change *** ../vim-8.2.2859/src/proto/change.pro 2020-09-15 21:34:14.998383526 +0200 --- src/proto/change.pro 2021-05-16 20:17:14.237969607 +0200 *************** *** 14,19 **** --- 14,20 ---- void appended_lines_mark(linenr_T lnum, long count); void deleted_lines(linenr_T lnum, long count); void deleted_lines_mark(linenr_T lnum, long count); + void changed_lines_buf(buf_T *buf, linenr_T lnum, linenr_T lnume, long xtra); void changed_lines(linenr_T lnum, colnr_T col, linenr_T lnume, long xtra); void unchanged(buf_T *buf, int ff, int always_inc_changedtick); void save_file_ff(buf_T *buf); *** ../vim-8.2.2859/src/textprop.c 2021-03-27 22:07:21.529728904 +0100 --- src/textprop.c 2021-05-16 20:17:21.685936231 +0200 *************** *** 345,351 **** } buf->b_has_textprop = TRUE; // this is never reset ! redraw_buf_later(buf, NOT_VALID); } /* --- 345,352 ---- } buf->b_has_textprop = TRUE; // this is never reset ! changed_lines_buf(buf, start_lnum, end_lnum + 1, 0); ! redraw_buf_later(buf, VALID); } /* *** ../vim-8.2.2859/src/version.c 2021-05-16 20:06:55.500792069 +0200 --- src/version.c 2021-05-16 20:18:40.557583393 +0200 *************** *** 752,753 **** --- 752,755 ---- { /* Add new patch number below this line */ + /**/ + 2860, /**/ -- Microsoft's definition of a boolean: TRUE, FALSE, MAYBE "Embrace and extend"...? /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///