entered = FALSE;
}
#endif
+
+/*
+ * Check if "key" is to interrupt us. Handles a key that has not had modifiers
+ * applied yet.
+ * Return the key with modifiers applied if so, NUL if not.
+ */
+ int
+check_for_interrupt(int key, int modifiers_arg)
+{
+ int modifiers = modifiers_arg;
+ int c = merge_modifyOtherKeys(key, &modifiers);
+
+ if ((c == Ctrl_C && ctrl_c_interrupts)
+ || (intr_char != Ctrl_C && c == intr_char))
+ {
+ got_int = TRUE;
+ return c;
+ }
+ return NUL;
+}
+
add_to_input_buf(string2, 3);
}
- if (len == 1 && ((string[0] == Ctrl_C && ctrl_c_interrupts)
- || (string[0] == intr_char && intr_char != Ctrl_C)))
+ // Check if the key interrupts.
{
- trash_input_buf();
- got_int = TRUE;
+ int int_ch = check_for_interrupt(key, modifiers);
+
+ if (int_ch != NUL)
+ {
+ trash_input_buf();
+ string[0] = int_ch;
+ len = 1;
+ }
}
add_to_input_buf(string, len);
string[ len++ ] = ch;
}
- if (len == 1 && ((ch == Ctrl_C && ctrl_c_interrupts)
- || ch == intr_char))
+ // Check if the key interrupts.
{
- trash_input_buf();
- got_int = TRUE;
+ int int_ch = check_for_interrupt(ch, modifiers);
+
+ if (int_ch != NUL)
+ {
+ ch = int_ch;
+ string[0] = ch;
+ len = 1;
+ trash_input_buf();
+ }
}
if (len == 1 && string[0] == CSI)
add_to_input_buf(string2, 3);
}
- if (len == 1 && ((string[0] == Ctrl_C && ctrl_c_interrupts)
-#ifdef UNIX
- || (intr_char != 0 && string[0] == intr_char)
-#endif
- ))
+ // Check if the key interrupts.
{
- trash_input_buf();
- got_int = TRUE;
+ int int_ch = check_for_interrupt(key, modifiers);
+
+ if (int_ch != NUL)
+ {
+ trash_input_buf();
+ string[0] = int_ch;
+ len = 1;
+ }
}
add_to_input_buf(string, len);
char_u *get_find_dialog_text(char_u *arg, int *wwordp, int *mcasep);
int gui_do_findrepl(int flags, char_u *find_text, char_u *repl_text, int down);
void gui_handle_drop(int x, int y, int_u modifiers, char_u **fnames, int count);
+int check_for_interrupt(int key, int modifiers_arg);
/* vim: set ft=c : */
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 1335,
/**/
1334,
/**/