Commit: patch 9.1.1281: extra newline output when editing stdin

0 views
Skip to first unread message

Christian Brabandt

unread,
Apr 6, 2025, 10:15:22 AM4/6/25
to vim...@googlegroups.com
patch 9.1.1281: extra newline output when editing stdin

Commit: https://github.com/vim/vim/commit/221927b2bfbd7de1623770bee4f6740356bb6c81
Author: Abhijit Barik <Abhiji...@ivanti.com>
Date: Sun Apr 6 16:12:06 2025 +0200

patch 9.1.1281: extra newline output when editing stdin

Problem: extra newline output when editing stdin
Solution: remove outputting when reading from stdin in non-terminal mode
(Abhijit Barik)

fixes: #16856
closes: #17047

Co-authored-by: LemonBoy <Lemo...@users.noreply.github.com>
Signed-off-by: Abhijit Barik <Abhiji...@ivanti.com>
Signed-off-by: Christian Brabandt <c...@256bit.org>

diff --git a/src/main.c b/src/main.c
index f603a52a5..776694628 100644
--- a/src/main.c
+++ b/src/main.c
@@ -660,7 +660,7 @@ vim_main2(void)
#if defined(UNIX) || defined(VMS)
// When switching screens and something caused a message from a vimrc
// script, need to output an extra newline on exit.
- if ((did_emsg || msg_didout) && *T_TI != NUL)
+ if ((did_emsg || msg_didout) && *T_TI != NUL && params.edit_type != EDIT_STDIN)
newline_on_exit = TRUE;
#endif

diff --git a/src/testdir/test_startup.vim b/src/testdir/test_startup.vim
index 8052aa883..03876749f 100644
--- a/src/testdir/test_startup.vim
+++ b/src/testdir/test_startup.vim
@@ -781,6 +781,68 @@ func Test_progpath()
call assert_match('vim
Reply all
Reply to author
Forward
0 new messages