forked from aniani/vim
patch 8.2.2352: if focus lost/gained is received twice code is not ignored
Problem: If the focus lost/gained escape sequence is received twice it is not ignored. (Christ van Willigen) Solution: Adjust the logic to ignore the escape code.
This commit is contained in:
parent
8f81b22e86
commit
d44cc593ce
22
src/term.c
22
src/term.c
@ -5708,18 +5708,24 @@ check_termcode(
|
||||
&& key_name[0] == KS_EXTRA
|
||||
)
|
||||
{
|
||||
if (key_name[1] == KE_FOCUSGAINED && !focus_state)
|
||||
if (key_name[1] == KE_FOCUSGAINED)
|
||||
{
|
||||
ui_focus_change(TRUE);
|
||||
did_cursorhold = TRUE;
|
||||
focus_state = TRUE;
|
||||
if (!focus_state)
|
||||
{
|
||||
ui_focus_change(TRUE);
|
||||
did_cursorhold = TRUE;
|
||||
focus_state = TRUE;
|
||||
}
|
||||
key_name[1] = (int)KE_IGNORE;
|
||||
}
|
||||
else if (key_name[1] == KE_FOCUSLOST && focus_state)
|
||||
else if (key_name[1] == KE_FOCUSLOST)
|
||||
{
|
||||
ui_focus_change(FALSE);
|
||||
did_cursorhold = TRUE;
|
||||
focus_state = FALSE;
|
||||
if (focus_state)
|
||||
{
|
||||
ui_focus_change(FALSE);
|
||||
did_cursorhold = TRUE;
|
||||
focus_state = FALSE;
|
||||
}
|
||||
key_name[1] = (int)KE_IGNORE;
|
||||
}
|
||||
}
|
||||
|
@ -750,6 +750,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
2352,
|
||||
/**/
|
||||
2351,
|
||||
/**/
|
||||
|
Loading…
x
Reference in New Issue
Block a user