On Sa, 28 Jun 2014, [email protected] wrote:
> Pardon the subject. What I mean is when using a visual selection of multiple
> words and doing CTRL-], it jumps to the tag matching the visual selection.
> However when doing CTRL-W_] it jumps to the tag matching the word under the
> cursor.
>
> This makes it difficult to deal with tags that span multiple words, such as
> "foo::bar". If the cursor is on "bar", it'll jump to "bar" (if it exists)
> instead of "foo::bar".
Yes, that is how it is currently implemented. Here is a patch, that
should allow what you want, but is a little bit ugly.
Best,
Christian
--
Gesellschaft braucht der Tor, und Einsamkeit der Weise.
-- Friedrich Rückert (Pseudonym: Freimund Raimar)
--
--
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].
For more options, visit https://groups.google.com/d/optout.
diff --git a/src/globals.h b/src/globals.h
--- a/src/globals.h
+++ b/src/globals.h
@@ -1619,6 +1619,9 @@ EXTERN FILE *time_fd INIT(= NULL); /* w
EXTERN int ignored;
EXTERN char *ignoredp;
+EXTERN char_u *ident_ptr INIT(= NULL); /* ptr to visually selected text */
+EXTERN int ident_len INIT(= 0); /* length of pointer */
+
/*
* Optional Farsi support. Include it here, so EXTERN and INIT are defined.
*/
diff --git a/src/normal.c b/src/normal.c
--- a/src/normal.c
+++ b/src/normal.c
@@ -5512,6 +5512,12 @@ nv_ident(cap)
if (cmdchar == POUND) /* the pound sign, '#' for English keyboards */
cmdchar = '#';
+ if (ident_ptr != NULL)
+ {
+ ptr = ident_ptr;
+ n = ident_len;
+ }
+
/*
* The "]", "CTRL-]" and "K" commands accept an argument in Visual mode.
*/
diff --git a/src/window.c b/src/window.c
--- a/src/window.c
+++ b/src/window.c
@@ -479,7 +479,7 @@ newwindow:
case ']':
case Ctrl_RSB:
CHECK_CMDWIN
- reset_VIsual_and_resel(); /* stop Visual mode */
+ get_visual_text(NULL, &ident_ptr, &ident_len); /* stops Visual mode */
if (Prenum)
postponed_split = Prenum;
else
@@ -488,6 +488,8 @@ newwindow:
/* Execute the command right here, required when
* "wincmd ]" was used in a function. */
do_nv_ident(Ctrl_RSB, NUL);
+ ident_ptr = NULL;
+ ident_len = 0;
break;
#ifdef FEAT_SEARCHPATH
@@ -590,6 +592,7 @@ wingotofile:
#endif
case ']':
case Ctrl_RSB:
+ get_visual_text(NULL, &ident_ptr, &ident_len); /* stops Visual mode */
reset_VIsual_and_resel(); /* stop Visual mode */
if (Prenum)
postponed_split = Prenum;
@@ -599,6 +602,8 @@ wingotofile:
/* Execute the command right here, required when
* "wincmd g}" was used in a function. */
do_nv_ident('g', xchar);
+ ident_ptr = NULL;
+ ident_len = 0;
break;
#ifdef FEAT_SEARCHPATH