Mercurial > vim
comparison src/window.c @ 6018:79950dae1d7d v7.4.349
updated for version 7.4.349
Problem: When there are matches to highlight the whole window is redrawn,
which is slow.
Solution: Only redraw everything when lines were inserted or deleted.
Reset b_mod_xlines when needed. (Alexey Radkov)
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Wed, 02 Jul 2014 17:16:58 +0200 |
parents | ce284c205558 |
children | 4625fa27ba6f |
comparison
equal
deleted
inserted
replaced
6017:7be65fcedd0b | 6018:79950dae1d7d |
---|---|
6902 if (wp->w_buffer->b_mod_bot < botlnum) | 6902 if (wp->w_buffer->b_mod_bot < botlnum) |
6903 wp->w_buffer->b_mod_bot = botlnum; | 6903 wp->w_buffer->b_mod_bot = botlnum; |
6904 } | 6904 } |
6905 else | 6905 else |
6906 { | 6906 { |
6907 wp->w_buffer->b_mod_set = TRUE; | |
6907 wp->w_buffer->b_mod_top = toplnum; | 6908 wp->w_buffer->b_mod_top = toplnum; |
6908 wp->w_buffer->b_mod_bot = botlnum; | 6909 wp->w_buffer->b_mod_bot = botlnum; |
6910 wp->w_buffer->b_mod_xlines = 0; | |
6909 } | 6911 } |
6910 m->pos.toplnum = toplnum; | 6912 m->pos.toplnum = toplnum; |
6911 m->pos.botlnum = botlnum; | 6913 m->pos.botlnum = botlnum; |
6912 wp->w_buffer->b_mod_set = TRUE; | |
6913 rtype = VALID; | 6914 rtype = VALID; |
6914 } | 6915 } |
6915 } | 6916 } |
6916 | 6917 |
6917 /* Insert new match. The match list is in ascending order with regard to | 6918 /* Insert new match. The match list is in ascending order with regard to |
6984 if (wp->w_buffer->b_mod_bot < cur->pos.botlnum) | 6985 if (wp->w_buffer->b_mod_bot < cur->pos.botlnum) |
6985 wp->w_buffer->b_mod_bot = cur->pos.botlnum; | 6986 wp->w_buffer->b_mod_bot = cur->pos.botlnum; |
6986 } | 6987 } |
6987 else | 6988 else |
6988 { | 6989 { |
6990 wp->w_buffer->b_mod_set = TRUE; | |
6989 wp->w_buffer->b_mod_top = cur->pos.toplnum; | 6991 wp->w_buffer->b_mod_top = cur->pos.toplnum; |
6990 wp->w_buffer->b_mod_bot = cur->pos.botlnum; | 6992 wp->w_buffer->b_mod_bot = cur->pos.botlnum; |
6991 } | 6993 wp->w_buffer->b_mod_xlines = 0; |
6992 wp->w_buffer->b_mod_set = TRUE; | 6994 } |
6993 rtype = VALID; | 6995 rtype = VALID; |
6994 } | 6996 } |
6995 vim_free(cur); | 6997 vim_free(cur); |
6996 redraw_later(rtype); | 6998 redraw_later(rtype); |
6997 return 0; | 6999 return 0; |