Saturday, November 2, 2013

Patch for tagselect.vim

--- orig/tagselect.vim 2012-12-26 20:01:17.000000000 -0800
+++ plugin/tagselect.vim 2013-10-25 13:31:12.261770130 -0700
@@ -155,7 +155,7 @@
endif
" This means, there was only one hit, and Vim must have already jumped to
" the jump. Don't do anything else.
- if a:cmd =~ 'jump' && results =~ '^\_s*$'
+ if a:cmd =~ 'jump' && results =~ '^\_s*$\|^\_s*"'
return 0
endif

I just started using Hari Krishna Dara's tagselect.vim plugin. It
captures the output of the :tjump and :tselect commands and displays
them in a buffer so that you can more easily search and navigate the
list.

I noticed that every now and then, instead of jumping directly to a
single tag, the Tjump command would open a window containing just
the name of the command and the name of the file being jumped to.

I tracked the problem down to the test at line 14 of
TagSelectMain():

" This means, there was only one hit, and Vim must have already jumped to
" the jump. Don't do anything else.
if a:cmd =~ 'jump' && results =~ '^\_s*$'
return 0
endif

As the comment says, this test should succeed if Vim has already
jumped to the jump. However, in Vim 7.4 (and Vim 7.2), if the jump
is to a file not already opened, Vim prints the name of the opened
file after it is opened and this name goes into the 'results'
variable, causing the test to fail.

I noticed that this file name is always enclosed in double-quotes,
so I fixed the problem by changing the test to this:

if a:cmd =~ 'jump' && results =~ '^\_s*$\|^\_s*"'

A patch is attached.

I sent the above problem description to the author a week ago and
have not received a reply.

The latest version of the plugin, 1.2.0, was last changed in June of
2005 and still contains a TODO list, which suggests that the author
has stopped working on it and has probably stopped supporting it.
In fact, I haven't seen anything from Hari Krisha Dara on the
vim_use or vim_dev lists in years. He used to be a regular, active
contributor.

So it seems we are back to discussing what to do with abandoned
plugins. Does anyone know what happened to Hari Krishna Dara? Any
suggestions for what should be done with tagselect.vim? Is there a
better plugin for this purpose that I've missed?

Regards,
Gary

--
--
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/groups/opt_out.

No comments: