fix(messages): no prompt/newlines for ext_messages filter command #39786)

Problem:  Redundant newlines and "Press any key" prompt with ext_messages
          for Visual filter command.

Solution: Remove newlines and prompt with ext_messages.
This commit is contained in:
Tomasz N
2026-06-03 16:20:28 +02:00
committed by GitHub
parent 1c0ffbcc9f
commit 2f577f7c5c
3 changed files with 17 additions and 3 deletions

View File

@@ -1339,7 +1339,7 @@ static void do_filter(linenr_T line1, linenr_T line2, exarg_T *eap, char *cmd, b
goto filterend;
}
if (!do_out) {
if (!do_out && !ui_has(kUIMessages)) {
msg_putchar('\n');
}
@@ -1446,7 +1446,9 @@ error:
// put cursor back in same position for ":w !cmd"
curwin->w_cursor = cursor_save;
no_wait_return--;
wait_return(false);
if (!ui_has(kUIMessages)) {
wait_return(false);
}
}
filterend:

View File

@@ -729,7 +729,9 @@ int call_shell(char *cmd, int opts, char *extra_shell_arg)
if (p_verbose > 3) {
verbose_enter();
smsg(0, _("Executing command: \"%s\""), cmd == NULL ? p_sh : cmd);
msg_putchar('\n');
if (!ui_has(kUIMessages)) {
msg_putchar('\n');
}
verbose_leave();
}

View File

@@ -383,6 +383,16 @@ describe('messages2', function()
]])
end)
it('no prompt and newlines with Visual filter command #38273', function()
set_msg_target_zero_ch()
feed('V:w !printf foo<CR>')
screen:expect([[
^ |
{1:~ }|*12
{1:~ }{4:foo}|
]])
end)
it('empty kind after message that does not flush immediately', function()
command('echon "foo" | echo')
screen:expect([[