Describe the bug
Vim does not always truncate long quickfix errors that are printed to the command-line after running :cc, :cnext and friends. This seems to occur only when the cursor is already on the same line as the quickfix error.
To Reproduce
vim --clean test.vim -S test.vim, with
" test.vim call setqflist([ \ { \ 'bufnr': 1, \ 'lnum': 1, \ 'col': 1, \ 'text': repeat('message ', 50) \ }, \ { \ 'bufnr': 1, \ 'lnum': 3, \ 'col': 9, \ 'text': repeat('message ', 50) \ }, \ { \ 'bufnr': 1, \ 'lnum': 3, \ 'col': 20, \ 'text': repeat('message ', 50) \ }, \ { \ 'bufnr': 1, \ 'lnum': 5, \ 'col': 9, \ 'text': repeat('message ', 50) \ } \ ])
:cc.hit-enter-prompt shows up.:cc again.It seems like when the error is on the same line as the cursor, the messages won't be truncated to fit into the window. This can also be observed with :cnext or :cprevious:
:cnext.:cnext again to jump to the third error (which is on the same line as the second one).Environment
Vim version 8.2.3134
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.![]()
Could it be ignoring the O flag in 'shortmess'? From :help 'shortmess':
O message for reading a file overwrites any previous message.
Also for quickfix message (e.g., ":cn").
Could it be ignoring the
Oflag in'shortmess'? From:help 'shortmess':O message for reading a file overwrites any previous message. Also for quickfix message (e.g., ":cn").
This is intentional. When you are jumping around with ":cnext" you don't usually want to get the hit-enter prompt, you might not even look at the message. But sometimes you wonder what's wrong. Then you just type :cc and you'll see the whole message.
This is usually what you want, but not always. Perhaps we should not show the whole message when using :cnext, only when using :cc?
—
You are receiving this because you commented.
When you are jumping around with ":cnext" you don't usually want to get the hit-enter prompt, you might not even look at the message
Yes, I agree. But the current behavior is inconsistent. When there are two errors on the same line and you execute :cnext to jump to the first error of that line, there's no hit-enter prompt. But when you execute :cnext again to jump to the next error on the same line, the whole message of the second error is printed, and that can be annoying.
It looks like Vim checks the current cursor position and if it's on the same line as the next error, the whole message is printed.
Perhaps we should not show the whole message when using :cnext, only when using :cc?
The whole message is printed after :cc only if the cursor is on the same line as the current error. For example, when you source the above script and you move the cursor to the bottom and run :cc, Vim will jump to (1, 1) and print the truncated message. But when you leave the cursor anywhere on the first line and run :cc, the whole message is printed. For me that's an inconsistency.
I do use :cnext and :cprevious a lot, but often there are multiple errors/warnings on the same line. When I jump to the first one, there's no hit-enter prompt but when I go to the next ones I get the entire message printed which pops up the hit-enter prompt.
—
You are receiving this because you commented.