Bram Moolenaar wrote:
Tony Mechelynck wrote:
When cycling through matches using ":cnext", if there are several matches in a
single long line, the line is only shortened the first time (but _not_ the
2nd, 3rd, etc.,) to avoid a Hit-Enter prompt.
Reproducible: every time.
Steps to reproduce:
1. :set wrap " I'm not sure this is necessary
2. :vimgrep /pattern/g filename
where:
- "filename" is a file or files with a number of lines longer than 'cmdheight'
times 'columns'
- /pattern/ will happen more than once in some long lines
3. :cn
4. Go to step 3.
Notice that the first match in any given line never produces a Hit-enter
prompt. Too-long lines have part of their non-matching text replaced by "...".
Actual result: 2nd, 3rd, etc. matches in any given line produces a Hit-enter
prompt; the line is displayed in full, overflowing the command-line.
Expected result: No hit-enter prompts.
Additional info: I've been seeing this for as long as I've used ":vimgrep"
(i.e., since shortly after that command was introduced) and I'm still seeing
it in gvim 7.0.201. I just never came around to report it. (I didn't use the
quickfix commands much before :vimgrep appeared, except for :helpgrep where
lines are shorter than 80 characters.)
This works as intended. It's a compromise between shortening the
message, to avoid the press-enter prompt, and being able to see the
whole message. The idea is that after jumping to a line with ":cnext"
you can do ":cc" to see the whole message. It's implemented in a way
that when displaying the same line twice the second time it displays the
whole line.
OK, but I'm not using :cc, I'm using :cn again, to display the next match,
which happens to be in the same line. The whole line is visible around the
cursor, or if it is too big for a split window I can (if I want to, but
usually I don't) use ^W_ to dilate the window, or if the line is too big for
the whole Vim window (!) it won't be shown in full at any one time even on the
command-line.
Currently if the line is shorter than the command-line area, just :cn will
show the next match by moving the cursor to it, which is what I like. If it's
longer (and the next match is in the same line), :cn disrupts the display and
I have to hit the space bar or the Enter key before seeing the next match at
the cursor, which is an annoyance.
A side-effect of the current behaviour is that once I have seen the (2nd,
etc.) match at the cursor, the [123 of 456] header is cleared away. Now that
header is the only part of the message I somewhat care about, because the rest
just repeats (with no syntax highlighting and no cursor) what I can see better
in the file window around the cursor (I'm not looking at a compiler error but
at a vimgrep match so there is no additional information). (I suppose :cc, or
:cN :cn, will display the count again, but only at the cost of disrupting the
display again, and <Space> or <Enter> will clear it again.)
Best regards,
Tony.
--
The confusion of a staff member is measured by the length of his
memos.
-- New York Times, Jan. 20, 1981