Mercurial > vim
diff src/screen.c @ 15402:c17b5e30a0af v8.1.0709
patch 8.1.0709: windows are updated for every added/deleted sign
commit https://github.com/vim/vim/commit/27a472c32ed5b5298bca50864570a4a71ec1d204
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Jan 9 21:47:30 2019 +0100
patch 8.1.0709: windows are updated for every added/deleted sign
Problem: Windows are updated for every added/deleted sign.
Solution: Do not call update_debug_sign(). Only redraw when the line with
the sign is visible. (idea from neovim #9479)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 09 Jan 2019 22:00:05 +0100 |
parents | ac5542aadd9c |
children | 29f3d59bb6f0 |
line wrap: on
line diff
--- a/src/screen.c +++ b/src/screen.c @@ -264,6 +264,17 @@ redraw_buf_later(buf_T *buf, int type) } void +redraw_buf_line_later(buf_T *buf, linenr_T lnum) +{ + win_T *wp; + + FOR_ALL_WINDOWS(wp) + if (wp->w_buffer == buf && lnum >= wp->w_topline + && lnum < wp->w_botline) + redrawWinline(wp, lnum); +} + + void redraw_buf_and_status_later(buf_T *buf, int type) { win_T *wp; @@ -978,26 +989,13 @@ update_debug_sign(buf_T *buf, linenr_T l win_foldinfo.fi_level = 0; # endif - /* update/delete a specific mark */ + // update/delete a specific sign + redraw_buf_line_later(buf, lnum); + + // check if it resulted in the need to redraw a window FOR_ALL_WINDOWS(wp) - { - if (buf != NULL && lnum > 0) - { - if (wp->w_buffer == buf && lnum >= wp->w_topline - && lnum < wp->w_botline) - { - if (wp->w_redraw_top == 0 || wp->w_redraw_top > lnum) - wp->w_redraw_top = lnum; - if (wp->w_redraw_bot == 0 || wp->w_redraw_bot < lnum) - wp->w_redraw_bot = lnum; - redraw_win_later(wp, VALID); - } - } - else - redraw_win_later(wp, VALID); if (wp->w_redr_type != 0) doit = TRUE; - } /* Return when there is nothing to do, screen updating is already * happening (recursive call), messages on the screen or still starting up.