mirror of
https://github.com/vim/vim.git
synced 2025-09-27 04:14:06 -04:00
updated for version 7.1-095
This commit is contained in:
30
src/eval.c
30
src/eval.c
@@ -9912,18 +9912,24 @@ f_getchar(argvars, rettv)
|
|||||||
|
|
||||||
++no_mapping;
|
++no_mapping;
|
||||||
++allow_keys;
|
++allow_keys;
|
||||||
if (argvars[0].v_type == VAR_UNKNOWN)
|
for (;;)
|
||||||
/* getchar(): blocking wait. */
|
{
|
||||||
n = safe_vgetc();
|
if (argvars[0].v_type == VAR_UNKNOWN)
|
||||||
else if (get_tv_number_chk(&argvars[0], &error) == 1)
|
/* getchar(): blocking wait. */
|
||||||
/* getchar(1): only check if char avail */
|
n = safe_vgetc();
|
||||||
n = vpeekc();
|
else if (get_tv_number_chk(&argvars[0], &error) == 1)
|
||||||
else if (error || vpeekc() == NUL)
|
/* getchar(1): only check if char avail */
|
||||||
/* illegal argument or getchar(0) and no char avail: return zero */
|
n = vpeekc();
|
||||||
n = 0;
|
else if (error || vpeekc() == NUL)
|
||||||
else
|
/* illegal argument or getchar(0) and no char avail: return zero */
|
||||||
/* getchar(0) and char avail: return char */
|
n = 0;
|
||||||
n = safe_vgetc();
|
else
|
||||||
|
/* getchar(0) and char avail: return char */
|
||||||
|
n = safe_vgetc();
|
||||||
|
if (n == K_IGNORE)
|
||||||
|
continue;
|
||||||
|
break;
|
||||||
|
}
|
||||||
--no_mapping;
|
--no_mapping;
|
||||||
--allow_keys;
|
--allow_keys;
|
||||||
|
|
||||||
|
@@ -1596,8 +1596,15 @@ vgetc()
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef FEAT_GUI
|
#ifdef FEAT_GUI
|
||||||
|
/* The caller doesn't need to know that the focus event is delayed
|
||||||
|
* until getting a character. */
|
||||||
|
if (c == K_FOCUSGAINED || c == K_FOCUSLOST)
|
||||||
|
{
|
||||||
|
ui_focus_change(c == K_FOCUSGAINED);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
/* Translate K_CSI to CSI. The special key is only used to avoid
|
/* Translate K_CSI to CSI. The special key is only used to avoid
|
||||||
* it being recognized as the start of a special key. */
|
* it being recognized as the start of a special key. */
|
||||||
if (c == K_CSI)
|
if (c == K_CSI)
|
||||||
|
13
src/gui.c
13
src/gui.c
@@ -4519,7 +4519,18 @@ gui_focus_change(in_focus)
|
|||||||
xim_set_focus(in_focus);
|
xim_set_focus(in_focus);
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
ui_focus_change(in_focus);
|
/* Put events in the input queue only when allowed.
|
||||||
|
* ui_focus_change() isn't called directly, because it invokes
|
||||||
|
* autocommands and that must not happen asynchronously. */
|
||||||
|
if (!hold_gui_events)
|
||||||
|
{
|
||||||
|
char_u bytes[3];
|
||||||
|
|
||||||
|
bytes[0] = CSI;
|
||||||
|
bytes[1] = KS_EXTRA;
|
||||||
|
bytes[2] = in_focus ? (int)KE_FOCUSGAINED : (int)KE_FOCUSLOST;
|
||||||
|
add_to_input_buf(bytes, 3);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -813,10 +813,15 @@ focus_in_event(GtkWidget *widget, GdkEventFocus *event, gpointer data)
|
|||||||
if (blink_state == BLINK_NONE)
|
if (blink_state == BLINK_NONE)
|
||||||
gui_mch_start_blink();
|
gui_mch_start_blink();
|
||||||
|
|
||||||
/* make sure keyboard input goes to the draw area (if this is focus for a window) */
|
/* make sure keyboard input goes to the draw area (if this is focus for a
|
||||||
|
* window) */
|
||||||
if (widget != gui.drawarea)
|
if (widget != gui.drawarea)
|
||||||
gtk_widget_grab_focus(gui.drawarea);
|
gtk_widget_grab_focus(gui.drawarea);
|
||||||
|
|
||||||
|
/* make sure the input buffer is read */
|
||||||
|
if (gtk_main_level() > 0)
|
||||||
|
gtk_main_quit();
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -829,6 +834,10 @@ focus_out_event(GtkWidget *widget, GdkEventFocus *event, gpointer data)
|
|||||||
if (blink_state != BLINK_NONE)
|
if (blink_state != BLINK_NONE)
|
||||||
gui_mch_stop_blink();
|
gui_mch_stop_blink();
|
||||||
|
|
||||||
|
/* make sure the input buffer is read */
|
||||||
|
if (gtk_main_level() > 0)
|
||||||
|
gtk_main_quit();
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -254,6 +254,8 @@ enum key_extra
|
|||||||
, KE_DROP /* DnD data is available */
|
, KE_DROP /* DnD data is available */
|
||||||
, KE_CURSORHOLD /* CursorHold event */
|
, KE_CURSORHOLD /* CursorHold event */
|
||||||
, KE_NOP /* doesn't do something */
|
, KE_NOP /* doesn't do something */
|
||||||
|
, KE_FOCUSGAINED /* focus gained */
|
||||||
|
, KE_FOCUSLOST /* focus lost */
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -445,6 +447,8 @@ enum key_extra
|
|||||||
#define K_CMDWIN TERMCAP2KEY(KS_EXTRA, KE_CMDWIN)
|
#define K_CMDWIN TERMCAP2KEY(KS_EXTRA, KE_CMDWIN)
|
||||||
|
|
||||||
#define K_DROP TERMCAP2KEY(KS_EXTRA, KE_DROP)
|
#define K_DROP TERMCAP2KEY(KS_EXTRA, KE_DROP)
|
||||||
|
#define K_FOCUSGAINED TERMCAP2KEY(KS_EXTRA, KE_FOCUSGAINED)
|
||||||
|
#define K_FOCUSLOST TERMCAP2KEY(KS_EXTRA, KE_FOCUSLOST)
|
||||||
|
|
||||||
#define K_CURSORHOLD TERMCAP2KEY(KS_EXTRA, KE_CURSORHOLD)
|
#define K_CURSORHOLD TERMCAP2KEY(KS_EXTRA, KE_CURSORHOLD)
|
||||||
|
|
||||||
|
@@ -666,6 +666,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 */
|
||||||
|
/**/
|
||||||
|
95,
|
||||||
/**/
|
/**/
|
||||||
94,
|
94,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user