Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


CtrlPTag still shows menu #451

naquad opened this Issue · 12 comments

2 participants


I'm finding a tag which has 3 entries, I choose one and I still get standard :tselect menu.
Looks to be a bug.

Also is there a way to set currently searched string (trying to replace :tj)?


It's not easy to avoid Vim's :tselect menu when using :tjump, since it's the default and the only behavior.

I'm going to need you to provide a test case including the tag names, the filenames corresponding to the tags. Also, the 3 tags files and their relative locations.

What do you mean by "set currently searched string"? Replacing :tjump would be even more complicated than avoiding :tselect.


My scenario in short: there's a folder tags file (which is relative to folder) and file-specific tag file (generated by VIM) which has absolute file path.

To reproduce this issue:

wget && \
  tar jxvf ctrl-tag.tar.bz2 && \
  cd ctrl-tag && sh

open VIM, then:

set tags=TAGS,tags

Choose the one with absolute filename. Kaboom!

By setting currently searched string I mean something smarter than:

call feedkeys("my_tag_here", 't')

The problem with this code is that it is slow. On every character tag is being searched which is redunant, because I have whole tag name.


The feedkeys() is only run once when you're done searching and are jumping to the tag. It's needed for respecting fold options. But what does it have anything to do with replacing :tj? And what do you consider smarter?


:tj / and feedkeys() questions are separate. :tj problem still remains. feedkeys() runs once, but it behaves like I'm typing whole world. This is the code:

function! s:JumpToTagOrMenu(tag)
  let t = taglist(a:tag)
  if len(t) <= 1
    exec 'tj ' . fnameescape(a:tag)
    call feedkeys(a:tag, 'mt')

As you can see I have whole tag already, but passing it to CtrlP with feedkeys() behaves like I'm typing it character by character. So my second question is: can I somehow pass tag to CtrlPTag? Kind of CtrlPTag ?


Oh I see. You can pass whole strings into the prompt with g:ctrlp_default_input.


Awesome! g:ctrl_default_input helped, thank you. Now the only problem left is tags.


It looks like there's no way to get the correct counts for use in :[count]tag. They desync with the counts on the menu as soon as there are 2 duplicates of the same tag in the active buffer. No way to recalculate and Vim doesn't provide any kind of reference.

This means using the :tselect menu in this case is unavoidable, but it's possible to enter the number for this menu automatically.


What about storing number in menu item (that is add(tag, index)) and then use it?


It's already doing that. But as I said, those numbers easily become unusable for :[count]tag.

@naquad naquad closed this

That still has the desyncing problem, I think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.