Mercurial > vim
comparison src/move.c @ 10597:472bff31a20a v8.0.0188
patch 8.0.0188: redrawing for 'cursorbind' is inefficient
commit https://github.com/vim/vim/commit/9506cad7a1a6e52a613f356de969cbd980815777
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Jan 15 13:53:49 2017 +0100
patch 8.0.0188: redrawing for 'cursorbind' is inefficient
Problem: Using NOT_VALID for redraw_later() to update the cursor
line/column highlighting is not efficient.
Solution: Call validate_cursor() when 'cul' or 'cuc' is set.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 15 Jan 2017 14:00:03 +0100 |
parents | 7230ee024c43 |
children | e39300d3d2cf |
comparison
equal
deleted
inserted
replaced
10596:b9ddd02d90be | 10597:472bff31a20a |
---|---|
2839 /* Make sure the cursor is in a valid position. Temporarily set | 2839 /* Make sure the cursor is in a valid position. Temporarily set |
2840 * "restart_edit" to allow the cursor to be beyond the EOL. */ | 2840 * "restart_edit" to allow the cursor to be beyond the EOL. */ |
2841 restart_edit_save = restart_edit; | 2841 restart_edit_save = restart_edit; |
2842 restart_edit = TRUE; | 2842 restart_edit = TRUE; |
2843 check_cursor(); | 2843 check_cursor(); |
2844 # ifdef FEAT_SYN_HL | 2844 if (curwin->w_p_cul || curwin->w_p_cuc) |
2845 if (curwin->w_p_cuc) | |
2846 validate_cursor(); | 2845 validate_cursor(); |
2847 # endif | |
2848 restart_edit = restart_edit_save; | 2846 restart_edit = restart_edit_save; |
2849 # ifdef FEAT_MBYTE | 2847 # ifdef FEAT_MBYTE |
2850 /* Correct cursor for multi-byte character. */ | 2848 /* Correct cursor for multi-byte character. */ |
2851 if (has_mbyte) | 2849 if (has_mbyte) |
2852 mb_adjust_cursor(); | 2850 mb_adjust_cursor(); |
2853 # endif | 2851 # endif |
2854 redraw_later(curwin->w_p_cul ? NOT_VALID : VALID); | 2852 redraw_later(VALID); |
2855 | 2853 |
2856 /* Only scroll when 'scrollbind' hasn't done this. */ | 2854 /* Only scroll when 'scrollbind' hasn't done this. */ |
2857 if (!curwin->w_p_scb) | 2855 if (!curwin->w_p_scb) |
2858 update_topline(); | 2856 update_topline(); |
2859 # ifdef FEAT_WINDOWS | 2857 # ifdef FEAT_WINDOWS |