forked from aniani/vim
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.
This commit is contained in:
31
src/screen.c
31
src/screen.c
@@ -728,7 +728,7 @@ screen_line(
|
|||||||
col += char_cells;
|
col += char_cells;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (clear_next)
|
if (clear_next && !skip_for_popup(row, col + coloff))
|
||||||
{
|
{
|
||||||
// Clear the second half of a double-wide character of which the left
|
// Clear the second half of a double-wide character of which the left
|
||||||
// half was overwritten with a single-wide character.
|
// half was overwritten with a single-wide character.
|
||||||
@@ -792,6 +792,8 @@ screen_line(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!skip_for_popup(row, col + coloff - prev_cells))
|
||||||
|
{
|
||||||
if (enc_dbcs != 0 && prev_cells > 1)
|
if (enc_dbcs != 0 && prev_cells > 1)
|
||||||
screen_char_2(off_to - prev_cells, row,
|
screen_char_2(off_to - prev_cells, row,
|
||||||
col + coloff - prev_cells);
|
col + coloff - prev_cells);
|
||||||
@@ -800,6 +802,7 @@ screen_line(
|
|||||||
col + coloff - prev_cells);
|
col + coloff - prev_cells);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
screen_fill(row, row + 1, col + coloff, clear_width + coloff,
|
screen_fill(row, row + 1, col + coloff, clear_width + coloff,
|
||||||
' ', ' ', 0);
|
' ', ' ', 0);
|
||||||
@@ -821,9 +824,7 @@ screen_line(
|
|||||||
// right of the window contents. But not on top of a popup window.
|
// right of the window contents. But not on top of a popup window.
|
||||||
if (coloff + col < Columns)
|
if (coloff + col < Columns)
|
||||||
{
|
{
|
||||||
#ifdef FEAT_PROP_POPUP
|
if (!skip_for_popup(row, col + coloff))
|
||||||
if (!blocked_by_popup(row, col + coloff))
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
int c;
|
int c;
|
||||||
|
|
||||||
@@ -1563,6 +1564,8 @@ screen_puts_len(
|
|||||||
&& !gui.in_use
|
&& !gui.in_use
|
||||||
#endif
|
#endif
|
||||||
&& mb_fix_col(col, row) != col)
|
&& mb_fix_col(col, row) != col)
|
||||||
|
{
|
||||||
|
if (!skip_for_popup(row, col - 1))
|
||||||
{
|
{
|
||||||
ScreenLines[off - 1] = ' ';
|
ScreenLines[off - 1] = ' ';
|
||||||
ScreenAttrs[off - 1] = 0;
|
ScreenAttrs[off - 1] = 0;
|
||||||
@@ -1573,6 +1576,7 @@ screen_puts_len(
|
|||||||
}
|
}
|
||||||
// redraw the previous cell, make it empty
|
// redraw the previous cell, make it empty
|
||||||
screen_char(off - 1, row, col - 1);
|
screen_char(off - 1, row, col - 1);
|
||||||
|
}
|
||||||
// force the cell at "col" to be redrawn
|
// force the cell at "col" to be redrawn
|
||||||
force_redraw_next = TRUE;
|
force_redraw_next = TRUE;
|
||||||
}
|
}
|
||||||
@@ -1651,11 +1655,7 @@ screen_puts_len(
|
|||||||
|| ScreenAttrs[off] != attr
|
|| ScreenAttrs[off] != attr
|
||||||
|| exmode_active;
|
|| exmode_active;
|
||||||
|
|
||||||
if ((need_redraw || force_redraw_this)
|
if ((need_redraw || force_redraw_this) && !skip_for_popup(row, col))
|
||||||
#ifdef FEAT_PROP_POPUP
|
|
||||||
&& !blocked_by_popup(row, col)
|
|
||||||
#endif
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
#if defined(FEAT_GUI) || defined(UNIX)
|
#if defined(FEAT_GUI) || defined(UNIX)
|
||||||
// The bold trick makes a single row of pixels appear in the next
|
// The bold trick makes a single row of pixels appear in the next
|
||||||
@@ -1772,7 +1772,7 @@ screen_puts_len(
|
|||||||
|
|
||||||
// If we detected the next character needs to be redrawn, but the text
|
// If we detected the next character needs to be redrawn, but the text
|
||||||
// doesn't extend up to there, update the character here.
|
// doesn't extend up to there, update the character here.
|
||||||
if (force_redraw_next && col < screen_Columns)
|
if (force_redraw_next && col < screen_Columns && !skip_for_popup(row, col))
|
||||||
{
|
{
|
||||||
if (enc_dbcs != 0 && dbcs_off2cells(off, max_off) > 1)
|
if (enc_dbcs != 0 && dbcs_off2cells(off, max_off) > 1)
|
||||||
screen_char_2(off, row, col);
|
screen_char_2(off, row, col);
|
||||||
@@ -2181,10 +2181,6 @@ screen_char(unsigned off, int row, int col)
|
|||||||
if (row >= screen_Rows || col >= screen_Columns)
|
if (row >= screen_Rows || col >= screen_Columns)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Skip if under the popup menu.
|
|
||||||
if (skip_for_popup(row, col))
|
|
||||||
return;
|
|
||||||
|
|
||||||
// Outputting a character in the last cell on the screen may scroll the
|
// Outputting a character in the last cell on the screen may scroll the
|
||||||
// screen up. Only do it when the "xn" termcap property is set, otherwise
|
// screen up. Only do it when the "xn" termcap property is set, otherwise
|
||||||
// mark the character invalid (update it when scrolled up).
|
// mark the character invalid (update it when scrolled up).
|
||||||
@@ -2315,11 +2311,13 @@ screen_draw_rectangle(
|
|||||||
{
|
{
|
||||||
if (enc_dbcs != 0 && dbcs_off2cells(off + c, max_off) > 1)
|
if (enc_dbcs != 0 && dbcs_off2cells(off + c, max_off) > 1)
|
||||||
{
|
{
|
||||||
|
if (!skip_for_popup(r, c))
|
||||||
screen_char_2(off + c, r, c);
|
screen_char_2(off + c, r, c);
|
||||||
++c;
|
++c;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if (!skip_for_popup(r, c))
|
||||||
screen_char(off + c, r, c);
|
screen_char(off + c, r, c);
|
||||||
if (utf_off2cells(off + c, max_off) > 1)
|
if (utf_off2cells(off + c, max_off) > 1)
|
||||||
++c;
|
++c;
|
||||||
@@ -2486,11 +2484,8 @@ screen_fill(
|
|||||||
|| force_next
|
|| force_next
|
||||||
#endif
|
#endif
|
||||||
)
|
)
|
||||||
#ifdef FEAT_PROP_POPUP
|
|
||||||
// Skip if under a(nother) popup.
|
// Skip if under a(nother) popup.
|
||||||
&& !blocked_by_popup(row, col)
|
&& !skip_for_popup(row, col))
|
||||||
#endif
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
#if defined(FEAT_GUI) || defined(UNIX)
|
#if defined(FEAT_GUI) || defined(UNIX)
|
||||||
// The bold trick may make a single row of pixels appear in
|
// The bold trick may make a single row of pixels appear in
|
||||||
|
@@ -699,6 +699,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
639,
|
||||||
/**/
|
/**/
|
||||||
638,
|
638,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user