The comment in the code is misleading - ex already allows passing a newline to the shell using a single backslash:
:!echo foo\
echo bar
This escaping is processed before entering this section of code (i.e. e.arg
has no backslash). To pass a newline preceded with a backslash:
:!echo foo\\\
bar
However, this default behavior is undone by the second if
clause which starts a new command at any newline (which is unnecessary since commands are split at unescaped newlines already) so the above examples fail. It seems the first if
clause was then added to counteract this bug, but it requires using additional backslashes. Splitting a command at a newline is maintained for blocks and global mode, which allow passing multiple commands in one, separated by newlines:
:g/./ !echo line \
p
In the above case, ex will print 'line' before every line.
https://github.com/vim/vim/pull/15120
(3 files)
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
@mohd-akram pushed 1 commit.
—
View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.
@mohd-akram pushed 1 commit.
You are receiving this because you are subscribed to this thread.
@mohd-akram pushed 1 commit.
You are receiving this because you are subscribed to this thread.
@mohd-akram pushed 1 commit.
You are receiving this because you are subscribed to this thread.
The fix for this turned out to be much simpler. The culprit was 417f5e7, so ex mode has been broken for around 14 years...
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.