[vim/vim] ex: fix multiple global commands and shell lines (PR #15120)

22 views
Skip to first unread message

Mohamed Akram

unread,
Jun 28, 2024, 10:15:03 AM (5 days ago) Jun 28
to vim/vim, Subscribed

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.

Fixes #6135
Fixes #7244

@konrad-schwarz


You can view, comment on, or merge this pull request online at:

  https://github.com/vim/vim/pull/15120

Commit Summary

  • ba753e9 ex: fix multiple global commands and shell lines

File Changes

(3 files)

Patch Links:


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/15120@github.com>

Mohamed Akram

unread,
Jun 28, 2024, 10:31:00 AM (5 days ago) Jun 28
to vim/vim, Push

@mohd-akram pushed 1 commit.

  • 2de90ca ex: fix multiple global commands and shell lines


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/15120/before/ba753e9271187d828ceb1092237b9231805fbf10/after/2de90ca73ff869a08403d56ecebffc8c5b717d79@github.com>

Mohamed Akram

unread,
Jun 28, 2024, 3:54:30 PM (4 days ago) Jun 28
to vim/vim, Push

@mohd-akram pushed 1 commit.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/15120/before/2de90ca73ff869a08403d56ecebffc8c5b717d79/after/3b2435a2f5b66ac21a07f772f8dffe28bec92161@github.com>

Mohamed Akram

unread,
Jun 28, 2024, 4:17:06 PM (4 days ago) Jun 28
to vim/vim, Push

@mohd-akram pushed 1 commit.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/15120/before/3b2435a2f5b66ac21a07f772f8dffe28bec92161/after/0f6a29c0b0b6049ad9e35da88148a8d3069238e4@github.com>

Mohamed Akram

unread,
Jun 29, 2024, 7:05:47 AM (4 days ago) Jun 29
to vim/vim, Push

@mohd-akram pushed 1 commit.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/15120/before/0f6a29c0b0b6049ad9e35da88148a8d3069238e4/after/7436b76ea909b98e38199670671f8acef2dfcefa@github.com>

Mohamed Akram

unread,
Jun 29, 2024, 7:12:30 AM (4 days ago) Jun 29
to vim/vim, Subscribed

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.Message ID: <vim/vim/pull/15120/c2198108313@github.com>

Reply all
Reply to author
Forward
0 new messages