Remove :open command

From the documentation itself:

  :[range]o[pen]                 Works like |:visual|: end Ex mode.
                                 {Vi: start editing in open mode}
  ...

  Vim does not support open mode, since it's not really useful.  For
  those situations where ":open" would start open mode Vim will leave Ex
  mode, which allows executing the same commands, but updates the whole
  screen instead of only one line.

Part of the reason behind this is to make removing vi_diff.txt easier,
although it's also because :open is not too useful.

Helped-by: @fdinoff
Helped-by: @dsummersl
Helped-by: @mhinz
Helped-by: @justinmk
This commit is contained in:
Michael Reed
2015-10-30 14:35:12 -04:00
parent 2bc97b2099
commit c40dff6453
8 changed files with 17 additions and 76 deletions

View File

@@ -6466,40 +6466,6 @@ static void ex_find(exarg_T *eap)
}
}
/*
* ":open" simulation: for now just work like ":visual".
*/
static void ex_open(exarg_T *eap)
{
regmatch_T regmatch;
char_u *p;
curwin->w_cursor.lnum = eap->line2;
beginline(BL_SOL | BL_FIX);
if (*eap->arg == '/') {
/* ":open /pattern/": put cursor in column found with pattern */
++eap->arg;
p = skip_regexp(eap->arg, '/', p_magic, NULL);
*p = NUL;
regmatch.regprog = vim_regcomp(eap->arg, p_magic ? RE_MAGIC : 0);
if (regmatch.regprog != NULL) {
regmatch.rm_ic = p_ic;
p = get_cursor_line_ptr();
if (vim_regexec(&regmatch, p, (colnr_T)0))
curwin->w_cursor.col = (colnr_T)(regmatch.startp[0] - p);
else
EMSG(_(e_nomatch));
vim_regfree(regmatch.regprog);
}
/* Move to the NUL, ignore any other arguments. */
eap->arg += STRLEN(eap->arg);
}
check_cursor();
eap->cmdidx = CMD_visual;
do_exedit(eap, NULL);
}
/*
* ":edit", ":badd", ":visual".
*/