To: vim_dev@googlegroups.com Subject: Patch 8.1.0856 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.1.0856 Problem: When scrolling a window other than the current one the cursorline highlighting is not always updated. (Jason Franklin) Solution: Call redraw_for_cursorline() after scrolling. Only set w_last_cursorline when drawing the cursor line. Reset the lines to be redrawn also when redrawing the whole window. Files: src/move.c, src/proto/move.pro, src/normal.c *** ../vim-8.1.0855/src/move.c 2019-01-26 17:28:22.228599112 +0100 --- src/move.c 2019-01-31 13:12:23.092498619 +0100 *************** *** 19,25 **** #include "vim.h" - static void redraw_for_cursorline(win_T *wp); static int scrolljump_value(void); static int check_top_offset(void); static void curs_rows(win_T *wp); --- 19,24 ---- *************** *** 128,134 **** * Redraw when w_cline_row changes and 'relativenumber' or 'cursorline' is * set. */ ! static void redraw_for_cursorline(win_T *wp) { if ((wp->w_p_rnu --- 127,133 ---- * Redraw when w_cline_row changes and 'relativenumber' or 'cursorline' is * set. */ ! void redraw_for_cursorline(win_T *wp) { if ((wp->w_p_rnu *************** *** 158,164 **** } else redraw_win_later(wp, SOME_VALID); - wp->w_last_cursorline = wp->w_cursor.lnum; } #endif } --- 157,162 ---- *** ../vim-8.1.0855/src/proto/move.pro 2018-09-25 22:17:51.111962197 +0200 --- src/proto/move.pro 2019-01-31 13:12:25.920478058 +0100 *************** *** 1,5 **** --- 1,6 ---- /* move.c */ void reset_cursorline(void); + void redraw_for_cursorline(win_T *wp); void update_topline_redraw(void); void update_topline(void); void update_curswant(void); *** ../vim-8.1.0855/src/normal.c 2019-01-26 17:28:22.228599112 +0100 --- src/normal.c 2019-01-31 13:12:14.728559444 +0100 *************** *** 4587,4592 **** --- 4587,4596 ---- } } # endif + # ifdef FEAT_SYN_HL + if (curwin != old_curwin && curwin->w_p_cul) + redraw_for_cursorline(curwin); + # endif curwin->w_redr_status = TRUE; *** ../vim-8.1.0855/src/version.c 2019-01-31 11:00:38.767870492 +0100 --- src/version.c 2019-01-31 13:21:56.800716653 +0100 *************** *** 785,786 **** --- 785,788 ---- { /* Add new patch number below this line */ + /**/ + 856, /**/ -- CONCORDE: Quickly, sir, come this way! LAUNCELOT: No! It's not right for my idiom. I must escape more ... more ... CONCORDE: Dramatically, sir? LAUNCELOT: Dramatically. "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///