Mercurial > vim
comparison src/change.c @ 18440:d6cb1e706fb7 v8.1.2214
patch 8.1.2214: too much is redrawn when 'cursorline' is set
Commit: https://github.com/vim/vim/commit/11a58af66fa5c442f0a22c5d59beabf187ed4e89
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Oct 24 22:32:31 2019 +0200
patch 8.1.2214: too much is redrawn when 'cursorline' is set
Problem: Too much is redrawn when 'cursorline' is set.
Solution: Don't do a complete redraw. (closes https://github.com/vim/vim/issues/5079)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 24 Oct 2019 22:45:04 +0200 |
parents | 5da355d15b88 |
children | bbea1f108187 |
comparison
equal
deleted
inserted
replaced
18439:1768dfc3a9f6 | 18440:d6cb1e706fb7 |
---|---|
607 // Take care of side effects for setting w_topline when folds have | 607 // Take care of side effects for setting w_topline when folds have |
608 // changed. Esp. when the buffer was changed in another window. | 608 // changed. Esp. when the buffer was changed in another window. |
609 if (hasAnyFolding(wp)) | 609 if (hasAnyFolding(wp)) |
610 set_topline(wp, wp->w_topline); | 610 set_topline(wp, wp->w_topline); |
611 #endif | 611 #endif |
612 // Relative numbering may require updating more. Cursor line | 612 // Relative numbering may require updating more. |
613 // highlighting probably needs to be updated if it's below the | 613 if (wp->w_p_rnu) |
614 // change (or is using screenline highlighting) | 614 redraw_win_later(wp, SOME_VALID); |
615 if (wp->w_p_rnu | |
616 #ifdef FEAT_SYN_HL | 615 #ifdef FEAT_SYN_HL |
617 || ((wp->w_p_cul && lnum <= wp->w_last_cursorline) | 616 // Cursor line highlighting probably need to be updated with |
618 || (wp->w_p_culopt_flags & CULOPT_SCRLINE)) | 617 // "VALID" if it's below the change. |
619 #endif | 618 // If the cursor line is inside the change we need to redraw more. |
620 ) | 619 if (wp->w_p_cul) |
621 redraw_win_later(wp, SOME_VALID); | 620 { |
621 if (xtra == 0) | |
622 redraw_win_later(wp, VALID); | |
623 else if (lnum <= wp->w_last_cursorline) | |
624 redraw_win_later(wp, SOME_VALID); | |
625 } | |
626 #endif | |
622 } | 627 } |
623 } | 628 } |
624 | 629 |
625 // Call update_screen() later, which checks out what needs to be redrawn, | 630 // Call update_screen() later, which checks out what needs to be redrawn, |
626 // since it notices b_mod_set and then uses b_mod_*. | 631 // since it notices b_mod_set and then uses b_mod_*. |