Wednesday, February 4, 2015

Re: gd search pattern stored in q/ history

Hi Paul!

On Di, 03 Feb 2015, Paul wrote:

> Long ago, the "gd" search for an identifier definition would cause the
> corresponding search pattern to be stored in the search history,
> invoked with "q/". These days, it isn't, thought it can still be
> accessed via the "/" register. It comes prefixed with a very-no-magic
> flag "\V". Is there a simple tweak to get it to show up again in the
> "q/" search history, possibly without the no-magic prefix "\V"?

Seems to be like this since Vim 7.0 something, so this must have been
very long ago.

However here is a patch:
diff --git a/src/normal.c b/src/normal.c
--- a/src/normal.c
+++ b/src/normal.c
@@ -4288,7 +4288,7 @@ nv_gd(oap, nchar, thisblock)
char_u *ptr;

if ((len = find_ident_under_cursor(&ptr, FIND_IDENT)) == 0
- || find_decl(ptr, len, nchar == 'd', thisblock, 0) == FAIL)
+ || find_decl(ptr, len, nchar == 'd', thisblock, SEARCH_HIS) == FAIL)
clearopbeep(oap);
#ifdef FEAT_FOLDING
else if ((fdo_flags & FDO_SEARCH) && KeyTyped && oap->op_type == OP_NOP)


Best,
Christian
--
F: Was macht ein Wikinger auf dem Eisberg?
A: Frieren!!!

--
--
You received this message from the "vim_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: