Mercurial > vim
comparison src/window.c @ 15380:f62d6bd18a49 v8.1.0698
patch 8.1.0698: clearing the window is used too often
commit https://github.com/vim/vim/commit/bf3250a8ad39797e3ccdac82d20c6f19533419e4
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Jan 6 17:25:29 2019 +0100
patch 8.1.0698: clearing the window is used too often
Problem: Clearing the window is used too often, causing the command line
to be cleared when opening a tab. (Miroslav Ko?k?r)
Solution: Use NOT_VALID instead of CLEAR. (suggested by Jason Franklin,
closes #630) Also do this for a few other places where clearing
the screen isn't really needed.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 06 Jan 2019 17:30:05 +0100 |
parents | 95678f27a704 |
children | 29f3d59bb6f0 |
comparison
equal
deleted
inserted
replaced
15379:8a81844b9925 | 15380:f62d6bd18a49 |
---|---|
1575 } | 1575 } |
1576 | 1576 |
1577 (void)win_comp_pos(); /* recompute window positions */ | 1577 (void)win_comp_pos(); /* recompute window positions */ |
1578 | 1578 |
1579 win_enter(wp, TRUE); | 1579 win_enter(wp, TRUE); |
1580 redraw_later(CLEAR); | 1580 redraw_all_later(NOT_VALID); |
1581 } | 1581 } |
1582 | 1582 |
1583 /* | 1583 /* |
1584 * rotate windows: if upwards TRUE the second window becomes the first one | 1584 * rotate windows: if upwards TRUE the second window becomes the first one |
1585 * if upwards FALSE the first window becomes the second one | 1585 * if upwards FALSE the first window becomes the second one |
1658 | 1658 |
1659 /* recompute w_winrow and w_wincol for all windows */ | 1659 /* recompute w_winrow and w_wincol for all windows */ |
1660 (void)win_comp_pos(); | 1660 (void)win_comp_pos(); |
1661 } | 1661 } |
1662 | 1662 |
1663 redraw_later(CLEAR); | 1663 redraw_all_later(NOT_VALID); |
1664 } | 1664 } |
1665 | 1665 |
1666 /* | 1666 /* |
1667 * Move the current window to the very top/bottom/left/right of the screen. | 1667 * Move the current window to the very top/bottom/left/right of the screen. |
1668 */ | 1668 */ |
1815 { | 1815 { |
1816 topfr->fr_win->w_winrow = row; | 1816 topfr->fr_win->w_winrow = row; |
1817 frame_new_height(topfr, height, FALSE, FALSE); | 1817 frame_new_height(topfr, height, FALSE, FALSE); |
1818 topfr->fr_win->w_wincol = col; | 1818 topfr->fr_win->w_wincol = col; |
1819 frame_new_width(topfr, width, FALSE, FALSE); | 1819 frame_new_width(topfr, width, FALSE, FALSE); |
1820 redraw_all_later(CLEAR); | 1820 redraw_all_later(NOT_VALID); |
1821 } | 1821 } |
1822 } | 1822 } |
1823 else if (topfr->fr_layout == FR_ROW) | 1823 else if (topfr->fr_layout == FR_ROW) |
1824 { | 1824 { |
1825 topfr->fr_width = width; | 1825 topfr->fr_width = width; |
3700 #endif | 3700 #endif |
3701 #ifdef FEAT_JOB_CHANNEL | 3701 #ifdef FEAT_JOB_CHANNEL |
3702 entering_window(curwin); | 3702 entering_window(curwin); |
3703 #endif | 3703 #endif |
3704 | 3704 |
3705 redraw_all_later(CLEAR); | 3705 redraw_all_later(NOT_VALID); |
3706 apply_autocmds(EVENT_WINNEW, NULL, NULL, FALSE, curbuf); | 3706 apply_autocmds(EVENT_WINNEW, NULL, NULL, FALSE, curbuf); |
3707 apply_autocmds(EVENT_WINENTER, NULL, NULL, FALSE, curbuf); | 3707 apply_autocmds(EVENT_WINENTER, NULL, NULL, FALSE, curbuf); |
3708 apply_autocmds(EVENT_TABNEW, NULL, NULL, FALSE, curbuf); | 3708 apply_autocmds(EVENT_TABNEW, NULL, NULL, FALSE, curbuf); |
3709 apply_autocmds(EVENT_TABENTER, NULL, NULL, FALSE, curbuf); | 3709 apply_autocmds(EVENT_TABENTER, NULL, NULL, FALSE, curbuf); |
3710 return OK; | 3710 return OK; |
3937 trigger_enter_autocmds, trigger_leave_autocmds); | 3937 trigger_enter_autocmds, trigger_leave_autocmds); |
3938 prevwin = next_prevwin; | 3938 prevwin = next_prevwin; |
3939 | 3939 |
3940 last_status(FALSE); /* status line may appear or disappear */ | 3940 last_status(FALSE); /* status line may appear or disappear */ |
3941 (void)win_comp_pos(); /* recompute w_winrow for all windows */ | 3941 (void)win_comp_pos(); /* recompute w_winrow for all windows */ |
3942 must_redraw = CLEAR; /* need to redraw everything */ | |
3943 #ifdef FEAT_DIFF | 3942 #ifdef FEAT_DIFF |
3944 diff_need_scrollbind = TRUE; | 3943 diff_need_scrollbind = TRUE; |
3945 #endif | 3944 #endif |
3946 | 3945 |
3947 /* The tabpage line may have appeared or disappeared, may need to resize | 3946 /* The tabpage line may have appeared or disappeared, may need to resize |
3971 apply_autocmds(EVENT_TABENTER, NULL, NULL, FALSE, curbuf); | 3970 apply_autocmds(EVENT_TABENTER, NULL, NULL, FALSE, curbuf); |
3972 if (old_curbuf != curbuf) | 3971 if (old_curbuf != curbuf) |
3973 apply_autocmds(EVENT_BUFENTER, NULL, NULL, FALSE, curbuf); | 3972 apply_autocmds(EVENT_BUFENTER, NULL, NULL, FALSE, curbuf); |
3974 } | 3973 } |
3975 | 3974 |
3976 redraw_all_later(CLEAR); | 3975 redraw_all_later(NOT_VALID); |
3977 } | 3976 } |
3978 | 3977 |
3979 /* | 3978 /* |
3980 * Go to tab page "n". For ":tab N" and "Ngt". | 3979 * Go to tab page "n". For ":tab N" and "Ngt". |
3981 * When "n" is 9999 go to the last tab page. | 3980 * When "n" is 9999 go to the last tab page. |
6567 { | 6566 { |
6568 wp = restore_snapshot_rec(curtab->tp_snapshot[idx], topframe); | 6567 wp = restore_snapshot_rec(curtab->tp_snapshot[idx], topframe); |
6569 win_comp_pos(); | 6568 win_comp_pos(); |
6570 if (wp != NULL && close_curwin) | 6569 if (wp != NULL && close_curwin) |
6571 win_goto(wp); | 6570 win_goto(wp); |
6572 redraw_all_later(CLEAR); | 6571 redraw_all_later(NOT_VALID); |
6573 } | 6572 } |
6574 clear_snapshot(curtab, idx); | 6573 clear_snapshot(curtab, idx); |
6575 } | 6574 } |
6576 | 6575 |
6577 /* | 6576 /* |