comparison src/popupmenu.c @ 18900:a9c47c623f4a v8.2.0011

patch 8.2.0011: screen updating wrong when opeing preview window Commit: https://github.com/vim/vim/commit/5e5a98d7de41457fabad4eb5af3d54cc93f05d0a Author: Bram Moolenaar <Bram@vim.org> Date: Sun Dec 15 14:55:33 2019 +0100 patch 8.2.0011: screen updating wrong when opeing preview window Problem: Screen updating wrong when opeing preview window. Solution: Redraw the window when the preview window opens.
author Bram Moolenaar <Bram@vim.org>
date Sun, 15 Dec 2019 15:00:04 +0100
parents fb2d26bc8ca1
children ba9f50bfda83
comparison
equal deleted inserted replaced
18899:17e4941b37d6 18900:a9c47c623f4a
911 redraw_later(SOME_VALID); 911 redraw_later(SOME_VALID);
912 912
913 // When the preview window was resized we need to 913 // When the preview window was resized we need to
914 // update the view on the buffer. Only go back to 914 // update the view on the buffer. Only go back to
915 // the window when needed, otherwise it will always be 915 // the window when needed, otherwise it will always be
916 // redraw. 916 // redrawn.
917 if (resized && win_valid(curwin_save)) 917 if (resized && win_valid(curwin_save))
918 { 918 {
919 ++no_u_sync; 919 ++no_u_sync;
920 win_enter(curwin_save, TRUE); 920 win_enter(curwin_save, TRUE);
921 --no_u_sync; 921 --no_u_sync;
924 924
925 // Update the screen before drawing the popup menu. 925 // Update the screen before drawing the popup menu.
926 // Enable updating the status lines. 926 // Enable updating the status lines.
927 pum_pretend_not_visible = TRUE; 927 pum_pretend_not_visible = TRUE;
928 // But don't draw text at the new popup menu position, 928 // But don't draw text at the new popup menu position,
929 // it causes flicker. 929 // it causes flicker. When resizing we need to draw
930 pum_will_redraw = TRUE; 930 // anyway, the position may change later.
931 pum_will_redraw = !resized;
931 update_screen(0); 932 update_screen(0);
932 pum_pretend_not_visible = FALSE; 933 pum_pretend_not_visible = FALSE;
933 pum_will_redraw = FALSE; 934 pum_will_redraw = FALSE;
934 935
935 if (!resized && win_valid(curwin_save)) 936 if (!resized && win_valid(curwin_save))
947 } 948 }
948 949
949 // May need to update the screen again when there are 950 // May need to update the screen again when there are
950 // autocommands involved. 951 // autocommands involved.
951 pum_pretend_not_visible = TRUE; 952 pum_pretend_not_visible = TRUE;
952 pum_will_redraw = TRUE; 953 pum_will_redraw = !resized;
953 update_screen(0); 954 update_screen(0);
954 pum_pretend_not_visible = FALSE; 955 pum_pretend_not_visible = FALSE;
955 pum_will_redraw = FALSE; 956 pum_will_redraw = FALSE;
956 call_update_screen = FALSE; 957 call_update_screen = FALSE;
957 } 958 }