version[]; @@ -49,6 +49,10 @@ extern void *ml_examine; extern int wheel_lines; extern int def_search_type; extern lbool search_wrapped; +extern int no_paste; +extern lbool pasting; +extern int no_edit_warn; +extern POSITION soft_eof; #if SHELL_ESCAPE || PIPEC extern void *ml_shell; #endif @@ -76,7 +80,7 @@ static int last_search_type; /* Type of last executed search */ static LINENUM number; /* The number typed by the user */ static long fraction; /* The fractional part of the number */ static struct loption *curropt; -static int opt_lower; +static lbool opt_lower; static int optflag; static lbool optgetname; static POSITION bottompos; @@ -85,6 +89,10 @@ static int save_bs_mode; static int save_proc_backspace; static int screen_trashed_value = 0; static lbool literal_char = FALSE; +static lbool ignoring_input = FALSE; +#if HAVE_TIME +static time_type ignoring_input_time; +#endif #if PIPEC static char pipec; #endif @@ -104,7 +112,7 @@ static void multi_search(constant char *pattern, int n, int silent); * This looks nicer if the command takes a long time before * updating the screen. */ -static void cmd_exec(void) +public void cmd_exec(void) { clear_attn(); clear_bot(); @@ -230,7 +238,7 @@ static void mca_opt_toggle(void) break; } forw_prompt = 0; - set_mlist(NULL, 0); + set_mlist(NULL, CF_OPTION); } /* @@ -239,7 +247,6 @@ static void mca_opt_toggle(void) static void exec_mca(void) { constant char *cbuf; - char *p; cmd_exec(); cbuf = get_cmdbuf(); @@ -256,6 +263,7 @@ static void exec_mca(void) case A_FILTER: search_type ^= SRCH_NO_MATCH; set_filter_pattern(cbuf, search_type); + soft_eof = NULL_POSITION; break; #endif case A_FIRSTCMD: @@ -282,7 +290,8 @@ static void exec_mca(void) match_brac(cbuf[1], cbuf[0], 0, (int) number); break; #if EXAMINE - case A_EXAMINE: + case A_EXAMINE: { + char *p; if (!secure_allow(SF_EXAMINE)) break; p = save(cbuf); @@ -292,7 +301,7 @@ static void exec_mca(void) /* If tag structure is loaded then clean it up. */ cleantags(); #endif - break; + break; } #endif #if SHELL_ESCAPE case A_SHELL: { @@ -415,16 +424,18 @@ static int mca_opt_nonfirst_char(char c) constant char *p; constant char *oname; lbool ambig; + struct loption *was_curropt; if (curropt != NULL) { - /* - * Already have a match for the name. - * Don't accept anything but erase/kill. - */ + /* Already have a match for the name. */ if (is_erase_char(c)) return (MCA_DONE); - return (MCA_MORE); + /* {{ Checking for TAB here is ugly. + * Also doesn't extend well -- can't do BACKTAB this way + * because it's a multichar sequence. }} */ + if (c != '\t') + return (MCA_MORE); } /* * Add char to cmd buffer and try to match @@ -433,26 +444,23 @@ static int mca_opt_nonfirst_char(char c) if (cmd_char(c) == CC_QUIT) return (MCA_DONE); p = get_cmdbuf(); - if (p == NULL) + if (p == NULL || p[0] == '\0') return (MCA_MORE); opt_lower = ASCII_IS_LOWER(p[0]); + was_curropt = curropt; curropt = findopt_name(&p, &oname, &ambig); if (curropt != NULL) { - /* - * Got a match. - * Remember the option and - * display the full option name. - */ - cmd_reset(); - mca_opt_toggle(); - for (p = oname; *p != '\0'; p++) + if (was_curropt == NULL) { - c = *p; - if (!opt_lower && ASCII_IS_LOWER(c)) - c = ASCII_TO_UPPER(c); - if (cmd_char(c) != CC_OK) - return (MCA_DONE); + /* + * Got a match. + * Remember the option and + * display the full option name. + */ + cmd_reset(); + mca_opt_toggle(); + cmd_setstring(oname, !opt_lower); } } else if (!ambig) { @@ -473,7 +481,7 @@ static int mca_opt_char(char c) * or one char of a long option name, * or one char of the option parameter. */ - if (curropt == NULL && len_cmdbuf() == 0) + if (curropt == NULL && cmdbuf_empty()) { int ret = mca_opt_first_char(c); if (ret != NO_MCA) *** 6463 LINES SKIPPED ***