• R/O
  • SSH

vim: Commit

Mirror of the Vim source from https://github.com/vim/vim


Commit MetaInfo

Revisionc3398c601bfa535fb470dbccc2718ad6c8397cf8 (tree)
Time2022-10-02 23:30:04
AuthorBram Moolenaar <Bram@vim....>
CommiterBram Moolenaar

Log Message

patch 9.0.0639: checking for popup in screen_char() is too late

Commit: https://github.com/vim/vim/commit/ff85d4a1076dc7d6fc3102f6560df3ad1af696ae
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Oct 2 15:21:04 2022 +0100

patch 9.0.0639: checking for popup in screen_char() is too late
Problem: Checking for popup in screen_char() is too late, the attribute has
already been changed.
Solution: Move check for popup to where screen_char() is called.

Change Summary

Incremental Difference

diff -r d3a64e0e7374 -r c3398c601bfa src/screen.c
--- a/src/screen.c Sun Oct 02 15:30:08 2022 +0200
+++ b/src/screen.c Sun Oct 02 16:30:04 2022 +0200
@@ -728,7 +728,7 @@
728728 col += char_cells;
729729 }
730730
731- if (clear_next)
731+ if (clear_next && !skip_for_popup(row, col + coloff))
732732 {
733733 // Clear the second half of a double-wide character of which the left
734734 // half was overwritten with a single-wide character.
@@ -792,12 +792,15 @@
792792 }
793793 }
794794
795- if (enc_dbcs != 0 && prev_cells > 1)
796- screen_char_2(off_to - prev_cells, row,
795+ if (!skip_for_popup(row, col + coloff - prev_cells))
796+ {
797+ if (enc_dbcs != 0 && prev_cells > 1)
798+ screen_char_2(off_to - prev_cells, row,
797799 col + coloff - prev_cells);
798- else
799- screen_char(off_to - prev_cells, row,
800+ else
801+ screen_char(off_to - prev_cells, row,
800802 col + coloff - prev_cells);
803+ }
801804 }
802805 }
803806 #endif
@@ -821,9 +824,7 @@
821824 // right of the window contents. But not on top of a popup window.
822825 if (coloff + col < Columns)
823826 {
824-#ifdef FEAT_PROP_POPUP
825- if (!blocked_by_popup(row, col + coloff))
826-#endif
827+ if (!skip_for_popup(row, col + coloff))
827828 {
828829 int c;
829830
@@ -1564,15 +1565,18 @@
15641565 #endif
15651566 && mb_fix_col(col, row) != col)
15661567 {
1567- ScreenLines[off - 1] = ' ';
1568- ScreenAttrs[off - 1] = 0;
1569- if (enc_utf8)
1568+ if (!skip_for_popup(row, col - 1))
15701569 {
1571- ScreenLinesUC[off - 1] = 0;
1572- ScreenLinesC[0][off - 1] = 0;
1570+ ScreenLines[off - 1] = ' ';
1571+ ScreenAttrs[off - 1] = 0;
1572+ if (enc_utf8)
1573+ {
1574+ ScreenLinesUC[off - 1] = 0;
1575+ ScreenLinesC[0][off - 1] = 0;
1576+ }
1577+ // redraw the previous cell, make it empty
1578+ screen_char(off - 1, row, col - 1);
15731579 }
1574- // redraw the previous cell, make it empty
1575- screen_char(off - 1, row, col - 1);
15761580 // force the cell at "col" to be redrawn
15771581 force_redraw_next = TRUE;
15781582 }
@@ -1651,11 +1655,7 @@
16511655 || ScreenAttrs[off] != attr
16521656 || exmode_active;
16531657
1654- if ((need_redraw || force_redraw_this)
1655-#ifdef FEAT_PROP_POPUP
1656- && !blocked_by_popup(row, col)
1657-#endif
1658- )
1658+ if ((need_redraw || force_redraw_this) && !skip_for_popup(row, col))
16591659 {
16601660 #if defined(FEAT_GUI) || defined(UNIX)
16611661 // The bold trick makes a single row of pixels appear in the next
@@ -1772,7 +1772,7 @@
17721772
17731773 // If we detected the next character needs to be redrawn, but the text
17741774 // doesn't extend up to there, update the character here.
1775- if (force_redraw_next && col < screen_Columns)
1775+ if (force_redraw_next && col < screen_Columns && !skip_for_popup(row, col))
17761776 {
17771777 if (enc_dbcs != 0 && dbcs_off2cells(off, max_off) > 1)
17781778 screen_char_2(off, row, col);
@@ -2181,10 +2181,6 @@
21812181 if (row >= screen_Rows || col >= screen_Columns)
21822182 return;
21832183
2184- // Skip if under the popup menu.
2185- if (skip_for_popup(row, col))
2186- return;
2187-
21882184 // Outputting a character in the last cell on the screen may scroll the
21892185 // screen up. Only do it when the "xn" termcap property is set, otherwise
21902186 // mark the character invalid (update it when scrolled up).
@@ -2315,12 +2311,14 @@
23152311 {
23162312 if (enc_dbcs != 0 && dbcs_off2cells(off + c, max_off) > 1)
23172313 {
2318- screen_char_2(off + c, r, c);
2314+ if (!skip_for_popup(r, c))
2315+ screen_char_2(off + c, r, c);
23192316 ++c;
23202317 }
23212318 else
23222319 {
2323- screen_char(off + c, r, c);
2320+ if (!skip_for_popup(r, c))
2321+ screen_char(off + c, r, c);
23242322 if (utf_off2cells(off + c, max_off) > 1)
23252323 ++c;
23262324 }
@@ -2486,11 +2484,8 @@
24862484 || force_next
24872485 #endif
24882486 )
2489-#ifdef FEAT_PROP_POPUP
24902487 // Skip if under a(nother) popup.
2491- && !blocked_by_popup(row, col)
2492-#endif
2493- )
2488+ && !skip_for_popup(row, col))
24942489 {
24952490 #if defined(FEAT_GUI) || defined(UNIX)
24962491 // The bold trick may make a single row of pixels appear in
diff -r d3a64e0e7374 -r c3398c601bfa src/version.c
--- a/src/version.c Sun Oct 02 15:30:08 2022 +0200
+++ b/src/version.c Sun Oct 02 16:30:04 2022 +0200
@@ -700,6 +700,8 @@
700700 static int included_patches[] =
701701 { /* Add new patch number below this line */
702702 /**/
703+ 639,
704+/**/
703705 638,
704706 /**/
705707 637,
Show on old repository browser