Permalink
Switch branches/tags
Commits on Jun 1, 2010
Commits on May 18, 2010
  1. Documentation updates

    wincent committed May 18, 2010
    Signed-off-by: Wincent Colaiuta <win@wincent.com>
  2. Mock VIM calls to get all specs passing again

    wincent committed May 18, 2010
    Recent commits (starting with f314c1e) changed the design of the Scanner
    class, such that rather than performing filename globbing internally for
    the purposes of exclusion, it "shelled out" back to VIM itself so that
    it could use VIM's "expand()" function and thus handle a wider range of
    exclusion patterns in the 'wildignore' setting.
    
    This, of course, broke the Scanner specs, and the Finder specs too,
    because the specs were always intended to be run in isolation from VIM,
    and in fact there _is_ no straightfoward way of running them in any
    other fashion.
    
    So here we use mocking and stubbing to get the specs passing again when
    running in isolation outside of the context of VIM. Later on will be
    adding "integration" tests which can be run from inside VIM itself to
    make sure that things actually work as expected.
    
    Signed-off-by: Wincent Colaiuta <win@wincent.com>
  3. Fix NameError in "rake spec"

    wincent committed May 18, 2010
    This error was being thrown when running "rake spec", but not when
    running "spec spec", seeing as the former is effectively running the
    specs in reverse order due to the --reverse option in the spec.opts
    file.
    
    Originally reported here:
    
      http://github.com/novas0x2a/Command-T/commit/235a7d722c5f663f483101e6cf86d59a54c794da
    
    Signed-off-by: Wincent Colaiuta <win@wincent.com>
Commits on May 17, 2010
  1. Make sure entries for "" or "." are alpha order

    novas0x2a committed with wincent May 11, 2010
    Dir entries are returned in file-system-dependent order. Extract a
    qsort comp function for alpha sort, and use it.
    
    Signed-off-by: Wincent Colaiuta <win@wincent.com>
  2. Make scanner tests resistant to order changes

    novas0x2a committed with wincent May 11, 2010
    These scanner tests don't care about order- they only care that the proper
    entries are returned (order is tested elsewhere). Sorting by score changes
    the order, but since we don't care, sort the expected and
    actual arrays before comparison.
    
    Signed-off-by: Wincent Colaiuta <win@wincent.com>
Commits on May 13, 2010
  1. Consistency fixes

    wincent committed May 13, 2010
    Always use the form "VIM::method_name" for accessing methods in the VIM
    modules, to match the convention in VIM's Ruby documentation (:h ruby).
    
    Signed-off-by: Wincent Colaiuta <win@wincent.com>
  2. More robust escaping for consumption by expand()

    wincent committed May 13, 2010
    Suggested by Mike Lundy <mike@fluffypenguin.org> here:
    
      http://github.com/wincent/Command-T/commit/a2b713d49bfb22e4a2afd17115835a5e7f00dd97#comments
    
    This is more robust than the previous manual escaping, as fnameescape()
    knows about platform-specific wildcards and special characeters,
    apparently.
    
    Signed-off-by: Wincent Colaiuta <win@wincent.com>
Commits on May 12, 2010
  1. Handle "wildcard" characters in filenames

    wincent committed May 12, 2010
    The recent change (commit f314c1e) to get VIM to handle exclusion
    checking for us via the expand() function will choke on paths with
    "special" wildcard characters in them (see 'h: wildcards' for a
    list).
    
    For example, a path like:
    
      /foo/bar/notes [Foo Support #abcdef-058505].txt
    
    Will cause en E16 range error when fed into expand() due to the "[" and
    "]" characters which are interpreted as delimiting an invalid range.
    
    So we escape:
    
      ?
      * (and by extension, **)
      [
      ]
      `
    
    Unfortunately, the docs say "Which wildcards are supported depends on
    the system", and lists "the common ones". We can only hope that the
    above list covers most cases and will have to handle any breakage which
    arises on specific platforms in the future.
    
    Note also, that in this commit we switch form expand() to glob(),
    because glob() takes a smaller range of "special" characters (just he
    wildcards) and so is less likely to choke on paths with special
    characters in them.
    
    Signed-off-by: Wincent Colaiuta <win@wincent.com>
  2. Replace Pathname-based code with faster inline solution

    wincent committed May 12, 2010
    On very large test cases (500,000 max files, 50 max depth), the
    performance of the code using Pathname is noticeably slower than the old
    code.
    
    This commit replaces the Pathname-based logic with a faster inline
    solution.
    
    Signed-off-by: Wincent Colaiuta <win@wincent.com>
Commits on May 11, 2010
  1. Bring wildignore behavior closer to VIM's own behaviour

    wincent committed May 11, 2010
    In commit f314c1e we tried to make Command-T react to the 'wildignore'
    setting in way that more closely matches VIM's own behaviour by
    using the builtin expand() function which takes into account
    'wildignore'.
    
    While this works quite well, there are still some discrepancies from
    VIM's actual behaviour.
    
    For example, while patterns like this work as expected with no
    surprises:
    
      *.o
      .git
      **/build
    
    A pattern like this:
    
      vendor/rails/**
    
    Will work differently in Command-T than it does in the rest of VIM.
    Specifically, if I type this in VIM:
    
      :e vendor/rails/<tab>
    
    Then VIM's autocomplete won't allow me to drill down into the directory
    because it is excluded by the 'wildignore' setting.
    
    Command-T, on the other hand, will allow me to see the contents of that
    directory. This is because internally, at the time the file names are
    checked, they are almost always absolute paths, because the default
    starting directory is ":pwd" which is itself provided by VIM as an
    absolute path. As such, VIM's expand() function checks to see if:
    
      /absolute/path/to/vendor/rails/
    
    Matches against the 'wildignore' pattern of:
    
      vendor/rails/**
    
    And decides that it does not match.
    
    As a work around, a user could specify a pattern like this:
    
      **/vendor/rails/**
    
    But it is a bit ugly because it doesn't fit well with the behaviour of
    VIM itself.
    
    The fix, then, is to not pass absolute paths into the expand() function,
    but to pass paths relative to the starting directory.
    
    In 99% of cases, the starting directory is the ":pwd", so the behaviour
    should then be identical to VIM's own behaviour.
    
    In the cases where the user has passed in an override for the starting
    directory (either relative or absolute), then the behaviour will diverge
    slightly from VIM's while still hopefully being consistent and intuitive
    from the user's perspective.
    
    For example, if :pwd is the HOME directory and the user invokes
    Command-T with:
    
      :CommandT path/to/some/rails/project
    
    Then a 'wildignore' which includes this pattern:
    
      vendor/rails/**
    
    Will exclude all files under:
    
      path/to/some/rails/prokect/vendor/rails/
    
    Which is probably what the user expects. For comparison, typing:
    
      :e path/to/some/rails/project/vendor/rails/<tab>
    
    Will autocomplete despite the 'wildignore' settings, which is consistent
    with the standard VIM behaviour as described previously.
    
    Signed-off-by: Wincent Colaiuta <win@wincent.com>
  2. Use more conservative language standard setting

    wincent committed May 11, 2010
    Previously we used "gnu99" as the C language standard. At least one
    user, however, has reported about getting warnings with this setting and
    having to manually edit the Makefile to set it to "c99":
    
      http://amix.dk/blog/post/19501
    
    So, seeing as we don't use any GNU extensions, try switching the std
    setting to "c99" and see if that makes any difference for such users.
    
    Signed-off-by: Wincent Colaiuta <win@wincent.com>
  3. Ignore built extension lib

    novas0x2a committed with wincent May 11, 2010
    This makes submodules happy.
    
    Signed-off-by: Wincent Colaiuta <win@wincent.com>
  4. Drop unnecessary parentheses

    wincent committed May 11, 2010
    Signed-off-by: Wincent Colaiuta <win@wincent.com>
  5. make Scanner.path_excluded use wildignore

    novas0x2a committed with wincent May 11, 2010
    fnmatch is a lossy replacement for vim's internal wildcard match. I
    reimplemented it by using wildignore directly (via expand) to perform the
    exclusion.
    
    Signed-off-by: Wincent Colaiuta <win@wincent.com>
Commits on Apr 29, 2010
  1. Add docs for ":CommandT some/other/path"

    wincent committed Apr 29, 2010
    Signed-off-by: Wincent Colaiuta <win@wincent.com>
  2. Update docs for 0.6 release

    wincent committed Apr 29, 2010
    Signed-off-by: Wincent Colaiuta <win@wincent.com>
  3. doc: mention :CommandTFlush in the OPTIONS section

    wincent committed Apr 29, 2010
    Make it clear to users that changes in the .vimrc will be picked up on
    next run, and immediate changes (via :let) will only be picked up if you
    do a :CommandTFlush.
    
    Signed-off-by: Wincent Colaiuta <win@wincent.com>
  4. Handle non-existent directories passed to :CommandT

    wincent committed Apr 29, 2010
    Gracefully handle non-existent directories passed in via ":CommandT
    path".
    
    Note that we catch the Errno:ENOENT exception only when the match window
    is shown, because we're interested in advising the user when they enter
    a dud path. (In contrast, we let Errno::ENOENT exceptions at other times
    just bubble up, as may be the case if the user has something funky with
    their filesystem and stuff appears in the listing but later claims to
    not exist.)
    
    This closes feature request #1522:
    
      https://wincent.com/issues/1522
    
    Signed-off-by: Wincent Colaiuta <win@wincent.com>
Commits on Apr 28, 2010
  1. Correctly handle operation from "/" directory

    wincent committed Apr 28, 2010
    Prior to this commit, operation from the root directory was broken
    because given paths like:
    
      /foo
      /bar
    
    These were scanned as:
    
      oo
      ar
    
    Instead of:
    
      foo
      bar
    
    The cause is actually the trailing "/" in "/". The same bug would occur
    if @path were ever something like "/foo/" or "/bar/" rather than "/foo"
    or "/bar" (although in practice this never occurs because the callers
    always pass in paths without trailing slashes).
    
    For example, given a directory "/foo" and file "/foo/bar", our prefix
    length is 4, and "/foo/bar"[5..-1] yields the desired "bar".
    
    If directory is passed in as "/foo/" then our prefix length ends up
    being 5 and we would incorrectly do "/foo/bar"[6..-1], which would yield
    "ar".
    
    Likewise directory "/" and file "/foo" yields prefix length 1, and we do
    "/foo"[2..-1] and get "oo".
    
    Stripping the trailing slash before calculating the prefix length fixes
    both cases. "/" becomes "", our prefix length is now 1, and our string
    "/foo"[1..-1] yields the desired "foo".
    
    This commit fixes the bug mentioned in commit 38837a8.
    
    Signed-off-by: Wincent Colaiuta <win@wincent.com>
  2. Add optional starting directory param to :CommandT

    wincent committed Apr 28, 2010
    This fulfills:
    
      https://wincent.com/issues/1522
    
    As noted in that ticket, looks like it has uncovered a latent bug
    elsewhere in the plug-in when the starting path is just "/".
    
    Signed-off-by: Wincent Colaiuta <win@wincent.com>
Commits on Apr 19, 2010
  1. doc: update link to screencasts

    wincent committed Apr 19, 2010
    Signed-off-by: Wincent Colaiuta <win@wincent.com>
Commits on Apr 14, 2010
  1. Add "trouble-shooting" label to help and reference it

    wincent committed Apr 14, 2010
    The Stub object will only be initiated if the load path is correctly set
    up, so if we get that far we can basically assume that the problem lies
    somewhere with the C extension.
    
    So instead of complaining about not being able to load "the necessary
    modules", explicitly mention the C extension and point people at the
    relevant section on the documentation.
    
    Signed-off-by: Wincent Colaiuta <win@wincent.com>
  2. doc: fix spelling

    wincent committed Apr 14, 2010
    Signed-off-by: Wincent Colaiuta <win@wincent.com>
Commits on Apr 11, 2010
  1. Update docs for 0.5.1 release

    wincent committed Apr 11, 2010
    Signed-off-by: Wincent Colaiuta <win@wincent.com>
  2. Ruby 1.9 fix (String#to_a no longer exists in 1.9)

    wincent committed Apr 11, 2010
    Reported by Michael Henry.
    
    Signed-off-by: Wincent Colaiuta <win@wincent.com>
Commits on Apr 10, 2010
  1. doc: add Windows-specific installation information

    wincent committed Apr 10, 2010
    Carl Boldoc wrote in with some tips on getting the plug-in installed on
    Windows as easily as possible, so I've worked the relevant links into
    the REQUIREMENTS and INSTALLATION sections of the documentation, along
    with a general reworking of the same in order to make the instructions
    read as clearly as possible for users of all platforms.
    
    Signed-off-by: Wincent Colaiuta <win@wincent.com>
Commits on Apr 3, 2010
  1. doc: rationalize help links

    wincent committed Apr 3, 2010
    Rather than using markers like "command-t-max-height" use the literal
    name of the option (eg. "g:CommandTMaxHeight") to make finding help on
    a specific setting more straightforward, and also enable links like
    "|g:CommandTMaxHeight|" within the documentation itself to work.
    
    We also add markers for options which didn't previously have them.
    
    Signed-off-by: Wincent Colaiuta <win@wincent.com>
  2. Update docs for 0.5 release

    wincent committed Apr 3, 2010
    Signed-off-by: Wincent Colaiuta <win@wincent.com>
  3. Check for overrides when setting up mappings

    wincent committed Apr 3, 2010
    Apart from providing a degree of customization which users could
    potentially find quite pleasing, this definitively addresses problems
    wherein the default mappings don't work on some terminals by providing
    users with a means to replace such mappings with working alternatives.
    
    See:
    
      https://wincent.com/issues/1531
    
    Signed-off-by: Wincent Colaiuta <win@wincent.com>
  4. Use hash to specify mappings

    wincent committed Apr 3, 2010
    This is a refactoring in preparation for a subsequent commit in which
    we will provide a means for users to override the default mappings. The
    hash structure allows us to conveniently process a bunch of different
    mappings -- some of which are unique and others which are multiple --
    and issue the call to the "map" method in a single place.
    
    Signed-off-by: Wincent Colaiuta <win@wincent.com>
Commits on Apr 2, 2010
  1. Fix typo in documentation

    wincent committed Apr 2, 2010
    Signed-off-by: Wincent Colaiuta <win@wincent.com>
  2. Don't map <Esc> for some terminal types

    wincent committed Apr 2, 2010
    As vt100 and xterm terminals send the arrow keys as sequences like
    <Esc>OA, VIM gets confused by bindings for the <Esc> key for those
    terminals (it actually interprets the arrow keys as sequences of
    commands).
    
    For now we avoid the problem on those terminals by not mapping <Esc> at
    all, but the long-term solution will be to provide a means for users to
    override the default mappings.
    
    See:
    
      https://wincent.com/issues/1531
    
    Signed-off-by: Wincent Colaiuta <win@wincent.com>
Commits on Mar 30, 2010
  1. Don't abort on hitting max depth

    wincent committed Mar 30, 2010
    We incorrectly aborted all scanning rather than just the recursion into
    the next level on hitting max depth.
    
    See:
    
      https://wincent.com/issues/1527#comment_5499
    
    Signed-off-by: Wincent Colaiuta <win@wincent.com>
  2. Drop "pressed" from some method names

    wincent committed Mar 30, 2010
    Favor imperative verbs rather than past participle.
    
    Signed-off-by: Wincent Colaiuta <win@wincent.com>