mirror of
https://github.com/vim/vim.git
synced 2025-09-28 04:24:06 -04:00
patch 8.1.1338: hang when concealing the '>' shown for half of wide char
Problem: Hang when concealing the '>' shown for a wide char that doesn't fit in the last cell. Solution: Put back the pointer when the '>' is not going to be displayed. (closes #4377)
This commit is contained in:
18
src/screen.c
18
src/screen.c
@@ -3176,7 +3176,6 @@ win_line(
|
|||||||
int vcol_off = 0; /* offset for concealed characters */
|
int vcol_off = 0; /* offset for concealed characters */
|
||||||
int did_wcol = FALSE;
|
int did_wcol = FALSE;
|
||||||
int match_conc = 0; /* cchar for match functions */
|
int match_conc = 0; /* cchar for match functions */
|
||||||
int has_match_conc = 0; /* match wants to conceal */
|
|
||||||
int old_boguscols = 0;
|
int old_boguscols = 0;
|
||||||
# define VCOL_HLC (vcol - vcol_off)
|
# define VCOL_HLC (vcol - vcol_off)
|
||||||
# define FIX_FOR_BOGUSCOLS \
|
# define FIX_FOR_BOGUSCOLS \
|
||||||
@@ -3747,7 +3746,8 @@ win_line(
|
|||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
#ifdef FEAT_CONCEAL
|
#ifdef FEAT_CONCEAL
|
||||||
has_match_conc = 0;
|
int has_match_conc = 0; // match wants to conceal
|
||||||
|
int did_decrement_ptr = FALSE;
|
||||||
#endif
|
#endif
|
||||||
/* Skip this quickly when working on the text. */
|
/* Skip this quickly when working on the text. */
|
||||||
if (draw_state != WL_LINE)
|
if (draw_state != WL_LINE)
|
||||||
@@ -4596,9 +4596,12 @@ win_line(
|
|||||||
mb_utf8 = FALSE;
|
mb_utf8 = FALSE;
|
||||||
mb_l = 1;
|
mb_l = 1;
|
||||||
multi_attr = HL_ATTR(HLF_AT);
|
multi_attr = HL_ATTR(HLF_AT);
|
||||||
/* Put pointer back so that the character will be
|
// Put pointer back so that the character will be
|
||||||
* displayed at the start of the next line. */
|
// displayed at the start of the next line.
|
||||||
--ptr;
|
--ptr;
|
||||||
|
#ifdef FEAT_CONCEAL
|
||||||
|
did_decrement_ptr = TRUE;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
else if (*ptr != NUL)
|
else if (*ptr != NUL)
|
||||||
ptr += mb_l - 1;
|
ptr += mb_l - 1;
|
||||||
@@ -5261,7 +5264,12 @@ win_line(
|
|||||||
prev_syntax_id = 0;
|
prev_syntax_id = 0;
|
||||||
is_concealing = FALSE;
|
is_concealing = FALSE;
|
||||||
}
|
}
|
||||||
#endif /* FEAT_CONCEAL */
|
|
||||||
|
if (n_skip > 0 && did_decrement_ptr)
|
||||||
|
// not showing the '>', put pointer back to avoid getting stuck
|
||||||
|
++ptr;
|
||||||
|
|
||||||
|
#endif // FEAT_CONCEAL
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef FEAT_CONCEAL
|
#ifdef FEAT_CONCEAL
|
||||||
|
@@ -767,6 +767,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 */
|
||||||
|
/**/
|
||||||
|
1338,
|
||||||
/**/
|
/**/
|
||||||
1337,
|
1337,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user