Ex mode: use getexline() instead of getexmodeline()

This changes Ex mode (Q, -e) to work like Vim's "improved Ex mode"
(gQ, -E).  That brings some small behavior differences, but should not
impact most Ex scripts (unless, for example, they depend on mappings
being disabled--but that can be solved for -e by skipping user config).

Before this change:
* the screen test hangs.

After this change:
* Q acts like gQ.
* -e/-es differs from -E/-Es only in its treatment of stdin.

This moves towards potentially removing getexmodeline().
(HINT: That does NOT mean "removing Ex mode", it means removing the
Vi-compatible Ex mode, which differs from Vim's "improved Ex mode" only
in some minor details (e.g. mappings are disabled).)

ref #1089 :-)~
This commit is contained in:
Justin M. Keyes
2018-06-04 02:06:32 +02:00
parent 3cc3506965
commit 9c2099d585
7 changed files with 39 additions and 41 deletions

View File

@@ -188,15 +188,8 @@ static void restore_dbg_stuff(struct dbg_stuff *dsp)
current_exception = dsp->current_exception;
}
/*
* do_exmode(): Repeatedly get commands for the "Ex" mode, until the ":vi"
* command is given.
*/
void
do_exmode (
int improved /* TRUE for "improved Ex" mode */
)
/// Repeatedly get commands for Ex mode, until the ":vi" command is given.
void do_exmode(int improved)
{
int save_msg_scroll;
int prev_msg_row;
@@ -232,11 +225,8 @@ do_exmode (
changedtick = curbuf->b_changedtick;
prev_msg_row = msg_row;
prev_line = curwin->w_cursor.lnum;
if (improved) {
cmdline_row = msg_row;
do_cmdline(NULL, getexline, NULL, 0);
} else
do_cmdline(NULL, getexmodeline, NULL, DOCMD_NOWAIT);
cmdline_row = msg_row;
do_cmdline(NULL, getexline, NULL, 0);
lines_left = Rows - 1;
if ((prev_line != curwin->w_cursor.lnum