diff options
| author | kq <97791950+Linykq@users.noreply.github.com> | 2026-03-27 06:08:32 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-03-27 07:08:32 -0400 |
| commit | 3898f34c5a215a172e8ab1f250e32c1393935aef (patch) | |
| tree | 0dd8ecc276a897ac02c7ad4bdd9f13a6480f019c /scripts/lintcommit.lua | |
| parent | 4b643d7068e871e4bee8ab74f3f0a054c242fa33 (diff) | |
| download | rneovim-3898f34c5a215a172e8ab1f250e32c1393935aef.tar.gz rneovim-3898f34c5a215a172e8ab1f250e32c1393935aef.tar.bz2 rneovim-3898f34c5a215a172e8ab1f250e32c1393935aef.zip | |
fix(messages): spurious newline with --headless + cmdheight=0 #38494
Problem:
When running nvim in headless mode with `cmdheight=0`, an extra newline
is prepended to output (eg. `nvim --clean --cmd 'set cmdheight=0'
--headless -c 'echo 1 | q' ` prints `\n1` instead of `1`), because
`!ui_has(kUIMessages)` is always true in headless mode, causing `p_ch ==
0` in `msg_start()` to unconditionally trigger `msg_putchar('\n')` which
writes a newline to stdout.
Solution:
When in headless printf mode with `p_ch == 0` and no prior output on the
current line, call `msg_puts_display("\n", ...)` directly instead of
`msg_putchar('\n')`, so the grid is still updated for correct screen
positioning but no newline is written to stdout.
Diffstat (limited to 'scripts/lintcommit.lua')
0 files changed, 0 insertions, 0 deletions