Gary Johnson wrote:

> When the search count message has been enabled, and the message
> string contains the results of a search, and gd or gD is executed
> to jump to the declaration of the word under the cursor, the cursor
> does jump to the first occurrence of the word in the buffer, but the
> search count message continues to show the results from the previous
> search.
> 
> I expect the search count message to show the results of the gd or
> gD search.  It is updated correctly after the first n or N command.
> 
> For example, start vim like this:
> 
>     $ vim -N -u NONE -i NONE -c 'set shortmess-=S'
> 
> Enter the following lines into the buffer:
> 
>     cat
>     dog
>     cat
>     dog
>     cat
> 
> While still on the last line, execute this search:
> 
>     ?dog
> 
> The cursor will jump to line 4 and the search count message will be
> 
>     [2/2]
> 
> Now move the cursor down a line to line 5 (over the word "cat") and
> type
> 
>     gD
> 
> The cursor will jump to line 1 as expected, but the search count
> message is still
> 
>     [2/2]
> 
> Now type
> 
>     n
> 
> The cursor will jump to line 3 as expected and the search count
> message will become
> 
>     [2/3]
> 
> also as expected.  Type n another two times and the cursor will jump
> back to line 1 and the search count message will be
> 
>     W [1/3]
> 
> as I expected it to be following the gD command.
> 
> The gd command behaves similarly.
> 
> The vim version is 8.2.3567.

Yes, that is confusing.  Drawing the actualy count is quite complicated,
it only really works when performing a search.  Clearing the text is a
simpler solution.

-- 
FIRST GUARD: Ah!  Now ... we're not allowed to ...
   SIR LAUNCELOT runs him through,  grabs his spear and stabs the other
   guard who collapses in a heap.  Hiccoughs quietly.
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///                                                                      \\\
\\\        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20211112100144.99BACC80053%40moolenaar.net.

Raspunde prin e-mail lui