Mercurial > vim
comparison src/screen.c @ 14079:b5e43a048878 v8.1.0057
patch 8.1.0057: popup menu displayed wrong when using autocmd
commit https://github.com/vim/vim/commit/6ba3ec1bace67513a352326864cebc16b3c5bc56
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Jun 16 15:32:38 2018 +0200
patch 8.1.0057: popup menu displayed wrong when using autocmd
Problem: Popup menu displayed wrong when using autocmd.
Solution: Use aucmd_prepbuf(). Force updating status line if the popup menu
is going to be redrawn anyway. (Christian Brabandt, closes #3009)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 16 Jun 2018 15:45:05 +0200 |
parents | e124262d435e |
children | 45c595c0ddaf |
comparison
equal
deleted
inserted
replaced
14078:7d731c628c83 | 14079:b5e43a048878 |
---|---|
123 * Buffer for one screen line (characters and attributes). | 123 * Buffer for one screen line (characters and attributes). |
124 */ | 124 */ |
125 static schar_T *current_ScreenLine; | 125 static schar_T *current_ScreenLine; |
126 | 126 |
127 static void win_update(win_T *wp); | 127 static void win_update(win_T *wp); |
128 static void win_redr_status(win_T *wp, int ignore_pum); | |
128 static void win_draw_end(win_T *wp, int c1, int c2, int row, int endrow, hlf_T hl); | 129 static void win_draw_end(win_T *wp, int c1, int c2, int row, int endrow, hlf_T hl); |
129 #ifdef FEAT_FOLDING | 130 #ifdef FEAT_FOLDING |
130 static void fold_line(win_T *wp, long fold_count, foldinfo_T *foldinfo, linenr_T lnum, int row); | 131 static void fold_line(win_T *wp, long fold_count, foldinfo_T *foldinfo, linenr_T lnum, int row); |
131 static void fill_foldcolumn(char_u *p, win_T *wp, int closed, linenr_T lnum); | 132 static void fill_foldcolumn(char_u *p, win_T *wp, int closed, linenr_T lnum); |
132 static void copy_text_attr(int off, char_u *buf, int len, int attr); | 133 static void copy_text_attr(int off, char_u *buf, int len, int attr); |
772 | 773 |
773 /* redraw status line after the window to minimize cursor movement */ | 774 /* redraw status line after the window to minimize cursor movement */ |
774 if (wp->w_redr_status) | 775 if (wp->w_redr_status) |
775 { | 776 { |
776 cursor_off(); | 777 cursor_off(); |
777 win_redr_status(wp); | 778 win_redr_status(wp, TRUE); // any popup menu will be redrawn below |
778 } | 779 } |
779 } | 780 } |
780 #if defined(FEAT_SEARCH_EXTRA) | 781 #if defined(FEAT_SEARCH_EXTRA) |
781 end_search_hl(); | 782 end_search_hl(); |
782 #endif | 783 #endif |
1028 FOR_ALL_WINDOWS(wp) | 1029 FOR_ALL_WINDOWS(wp) |
1029 { | 1030 { |
1030 if (wp->w_redr_type != 0) | 1031 if (wp->w_redr_type != 0) |
1031 win_update(wp); | 1032 win_update(wp); |
1032 if (wp->w_redr_status) | 1033 if (wp->w_redr_status) |
1033 win_redr_status(wp); | 1034 win_redr_status(wp, FALSE); |
1034 } | 1035 } |
1035 | 1036 |
1036 update_finish(); | 1037 update_finish(); |
1037 } | 1038 } |
1038 #endif | 1039 #endif |
1072 # endif | 1073 # endif |
1073 # ifdef FEAT_STL_OPT | 1074 # ifdef FEAT_STL_OPT |
1074 || *p_stl != NUL || *wp->w_p_stl != NUL | 1075 || *p_stl != NUL || *wp->w_p_stl != NUL |
1075 # endif | 1076 # endif |
1076 ) | 1077 ) |
1077 win_redr_status(wp); | 1078 win_redr_status(wp, FALSE); |
1078 | 1079 |
1079 update_finish(); | 1080 update_finish(); |
1080 } | 1081 } |
1081 #endif | 1082 #endif |
1082 | 1083 |
6533 { | 6534 { |
6534 win_T *wp; | 6535 win_T *wp; |
6535 | 6536 |
6536 FOR_ALL_WINDOWS(wp) | 6537 FOR_ALL_WINDOWS(wp) |
6537 if (wp->w_redr_status) | 6538 if (wp->w_redr_status) |
6538 win_redr_status(wp); | 6539 win_redr_status(wp, FALSE); |
6539 if (redraw_tabline) | 6540 if (redraw_tabline) |
6540 draw_tabline(); | 6541 draw_tabline(); |
6541 } | 6542 } |
6542 | 6543 |
6543 #if defined(FEAT_WILDMENU) || defined(PROTO) | 6544 #if defined(FEAT_WILDMENU) || defined(PROTO) |
6862 | 6863 |
6863 /* | 6864 /* |
6864 * Redraw the status line of window wp. | 6865 * Redraw the status line of window wp. |
6865 * | 6866 * |
6866 * If inversion is possible we use it. Else '=' characters are used. | 6867 * If inversion is possible we use it. Else '=' characters are used. |
6868 * If "ignore_pum" is TRUE, also redraw statusline when the popup menu is | |
6869 * displayed. | |
6867 */ | 6870 */ |
6868 void | 6871 static void |
6869 win_redr_status(win_T *wp) | 6872 win_redr_status(win_T *wp, int ignore_pum) |
6870 { | 6873 { |
6871 int row; | 6874 int row; |
6872 char_u *p; | 6875 char_u *p; |
6873 int len; | 6876 int len; |
6874 int fillchar; | 6877 int fillchar; |
6888 /* no status line, can only be last window */ | 6891 /* no status line, can only be last window */ |
6889 redraw_cmdline = TRUE; | 6892 redraw_cmdline = TRUE; |
6890 } | 6893 } |
6891 else if (!redrawing() | 6894 else if (!redrawing() |
6892 #ifdef FEAT_INS_EXPAND | 6895 #ifdef FEAT_INS_EXPAND |
6893 /* don't update status line when popup menu is visible and may be | 6896 // don't update status line when popup menu is visible and may be |
6894 * drawn over it */ | 6897 // drawn over it, unless it will be redrawn later |
6895 || pum_visible() | 6898 || (!ignore_pum && pum_visible()) |
6896 #endif | 6899 #endif |
6897 ) | 6900 ) |
6898 { | 6901 { |
6899 /* Don't redraw right now, do it later. */ | 6902 /* Don't redraw right now, do it later. */ |
6900 wp->w_redr_status = TRUE; | 6903 wp->w_redr_status = TRUE; |