int screensize; // and its size
int tabstop;
int last_forward_char; // last char searched for with 'f' (int because of Unicode)
- char erase_char; // the users erase character
+#if ENABLE_FEATURE_VI_CRASHME
char last_input_char; // last char read from user
+#endif
#if ENABLE_FEATURE_VI_DOT_CMD
smallint adding2q; // are we currently adding user input to q
#define screenbegin (G.screenbegin )
#define tabstop (G.tabstop )
#define last_forward_char (G.last_forward_char )
-#define erase_char (G.erase_char )
+#if ENABLE_FEATURE_VI_CRASHME
#define last_input_char (G.last_input_char )
+#endif
#if ENABLE_FEATURE_VI_READONLY
#define readonly_mode (G.readonly_mode )
#else
{
// no TERMIOS_CLEAR_ISIG: leave ISIG on - allow signals
set_termios_to_raw(STDIN_FILENO, &term_orig, TERMIOS_RAW_CRNL);
- erase_char = term_orig.c_cc[VERASE];
}
static void cookmode(void)
c = get_one_char();
if (c == '\n' || c == '\r' || c == 27)
break; // this is end of input
- if (c == erase_char || c == 8 || c == 127) {
+ if (c == term_orig.c_cc[VERASE] || c == 8 || c == 127) {
// user wants to erase prev char
buf[--i] = '\0';
write1("\b \b"); // erase char on screen
if ((p[-1] != '\n') && (dot > text)) {
p--;
}
- } else if (c == erase_char || c == 8 || c == 127) { // Is this a BS
+ } else if (c == term_orig.c_cc[VERASE] || c == 8 || c == 127) { // Is this a BS
if (p > text) {
p--;
p = text_hole_delete(p, p, ALLOW_UNDO_QUEUED); // shrink buffer 1 char
mark[26] = mark[27] = text; // init "previous context"
#endif
- last_forward_char = last_input_char = '\0';
+ last_forward_char = '\0';
+#if ENABLE_FEATURE_VI_CRASHME
+ last_input_char = '\0';
+#endif
crow = 0;
ccol = 0;
}
}
#endif
- last_input_char = c = get_one_char(); // get a cmd from user
+ c = get_one_char(); // get a cmd from user
+#if ENABLE_FEATURE_VI_CRASHME
+ last_input_char = c;
+#endif
#if ENABLE_FEATURE_VI_YANKMARK
// save a copy of the current line- for the 'U" command
if (begin_line(dot) != cur_line) {