Characters entered do not match file list

  1. Andrew Vit

    I've got what at first glance looks like a working installation of Command-T. I can start it, get the prompt, and see a list of files. I can scroll through the file list and open one.

    However, the match list isn't working right. Say I enter random letters like "qzjx", the list of files changes with each keypress but the files don't correspond to what I've entered. (I would expect to see no files for this random sequence.) Also, the list updates only for the first 4 keypresses. Any more characters stop "refining" the list.

    This is so random, I don't know where to start troubleshooting it...

    • Mac OS 10.7.4
    • MacVim 7.3 (64)
    • Command-T 1.4 installed with Pathogen
    • Compiled with system ruby
  2. Greg Hurrell

    Have you got a screenshot showing the match listing when something unexpected happens?

    My guess is that the files do match, but in the fuzzy sense (ie. the characters are not consecutive in the matched files), and that is what is producing the confusion.

  3. Andrew Vit

    I'm used to TextMate and similar fuzzy matchers, so yes I'm certain of this. Here's a couple screenshots:

    For the first 4 characters entered, the list updates slightly (but still has non-matching files). After that it stops updating, even if I backspace the text out and try re-typing. However, everything else is responsive. I can tab into the list, scroll around and open a file without problems.

    I've tried :CommandTFlush but that didn't help.

  4. Greg Hurrell

    It's hard to imagine what might cause this. What are you using to provide the custom status line? I'm wondering if it might be hooking into Command-T in such a way that it's introducing the odd behavior.

  5. Andrew Vit

    The statusline is from vim-powerline. I tried clearing out my .vimrc completely and pointing pathogen to a stripped bundle directory containing only command-t, leaving just:

       set nocompatible
       call pathogen#infect('~/.vim/bundle2')

    And .vim/autoload has just pathogen.vim, so I'm pretty sure it's not a conflict with another vim plugin.

    Now, my ~/.vim is actually symlinked to my dotfiles/vim, do you think this might cause a broken path in the compiled files or somewhere in the plugin? I'm scratching my head here too.

  6. Andrew Vit Created , edited

    So I tried clearing out my MacVim and Command-T installation and starting from scratch. Recompiling both under 1.9.3-p1.9.4 (rvm) led to a SEGV when starting :CommandT. There are a few warnings in the Command-T compiler, I'm not sure if any of this is relevant:

    $ rake make
    
    /Users/andrew/.rvm/gems/ruby-1.9.3-p194/gems/rake-0.8.7/lib/rake/alt_system.rb:32: Use RbConfig instead of obsolete and deprecated Config.
    (in /Users/andrew/Dropbox/dotfiles/vim/bundle/command-t)
    /Users/andrew/.rvm/rubies/ruby-1.9.3-p194/bin/ruby extconf.rb
    checking for ruby.h... yes
    creating Makefile
    compiling ext.c
    ext.c: In function ‘CommandT_option_from_hash’:
    ext.c:35: warning: ISO C90 forbids mixed declarations and code
    compiling match.c
    match.c: In function ‘recursive_match’:
    match.c:56: warning: ISO C90 forbids mixed declarations and code
    match.c:77: warning: ISO C90 forbids mixed declarations and code
    match.c: In function ‘CommandTMatch_initialize’:
    match.c:140: warning: ISO C90 forbids mixed declarations and code
    match.c:154: warning: ISO C90 forbids mixed declarations and code
    compiling matcher.c
    matcher.c: In function ‘CommandTMatcher_initialize’:
    matcher.c:88: warning: ISO C90 forbids mixed declarations and code
    matcher.c:91: warning: ISO C90 forbids mixed declarations and code
    matcher.c: In function ‘CommandTMatcher_sorted_matches_for’:
    matcher.c:117: warning: ISO C90 forbids mixed declarations and code
    matcher.c: In function ‘CommandTMatcher_matches_for’:
    matcher.c:139: warning: ISO C90 forbids mixed declarations and code
    matcher.c:155: warning: ISO C90 forbids mixed declarations and code
    linking shared-object ext.bundle
    

    At some point I got it to display this error in the status bar but I couldn't reproduce it:

    Error detected while processing function <SNR>21_CommandTShowFileFinder:
    line    2:
    NoMethodError: undefined method `print_no_such_file_or_directory' for nil:NilClass
    Press ENTER or type command to continue
    

    Since it was originally installed with system ruby and was "almost" working, I tried rvm ruby 1.8.7-p358. That didn't show any compilation warnings, and it fixed the problem. Hope this info helps future readers.

  7. Greg Hurrell

    FWIW, the symlink should definitely not be a problem (I also have a symlink for my ~/.vim). To my eye the compilation warnings under 1.9.x look harmless enough. Glad you got it sorted out in the end.

Reply

This topic is now closed.