Teach CommandT::Stub to handle show_buffer_finder

If for some reason you didn't compile the extension before trying to use
the buffer finder you would trigger an error because the CommandT::Stub
class didn't implement the #show_buffer_finder method.

As the number of stubbed methods has now reached three, this commit also
includes a refactoring to eliminate the repetition in the method
definitions.

Signed-off-by: Wincent Colaiuta <win@wincent.com>
Use multiple path caches, keyed off directories

This is an initial, naïve implementation. All it does is store separate
caches for each path it is asked to scan. While this works fine, before
it can be released it needs a one key thing: people should be able to
turn it off, or otherwise configure how many different directories
should be cached.

Note that there's no cleverness here; if you work for a while in
directory "/foo" and later change into "/foo/bar", it scans the new
directory rather than trying to reuse the path info that it obtained
when scanning the first directory.

Requested in:
  https://wincent.com/issues/1878

Signed-off-by: Wincent Colaiuta <win@wincent.com>
Add g:CommandTMaxCachedDirectories option

This allows the user to specify an upper limit on the number of caches
which Command-T will use when changing directories. The default of 1
preserves the existing behavior, meaning that each time you change into
a different directory, Command-T will scan it.

Set to a higher number to increase the number of cached directories, or
to 0 for no limit at all.

Signed-off-by: Wincent Colaiuta <win@wincent.com>
Merge branch 'multi-cache'

Related ticket:

  https://wincent.com/issues/1878
Fix possible 'rake make' breakage on Windows

I've had a report that '&&' can cause problems on Windows, so this seems
like a harmless enough fix. See:

  https://wincent.com/issues/1888

Signed-off-by: Wincent Colaiuta <win@wincent.com>
Ensure mappings use nnoremap.

This fixes a bug when the user redefines : to ;
Previously \t and \b would not work in this case.
docs: use nnoremap in examples

To match the mapping command used internally since commit 56d37ff.

Signed-off-by: Wincent Colaiuta <win@wincent.com>
doc: update contributor list

Signed-off-by: Wincent Colaiuta <win@wincent.com>
Record and restore window widths

Previously we stored and restored only window heights. It's been pointed
out, however, that when using Command-T Vim will reset horizontal sizes
for vertically-split windows as well, so we need to store and restore
window widths as well.

Based on patch posted by anonymous submitter here:

  https://wincent.com/issues/1896

Signed-off-by: Wincent Colaiuta <win@wincent.com>
Make it possible to select file from jump list
Minor stylistic clean-up for jump finder

Tweaks to bring the jump finder code into line with the conventions of
the rest of the code base:

  - add a little more detail to the :CommandTJump documentation
  - add Marian Schubert to contributors list
  - alphabetize finder methods in command-t.vim file
  - move getJumpsLines functionality down into Ruby; in general the
    VimScript portion of the plug-in is intended to be a thin wrapper
    only, and all the real work is done from Ruby
  - use "jump" singular rather than plural, because Vim calls it the
    "jumplist" and the other finders all use the singular ("buffer
    finder", "file finder" and not "buffers finder" and "files finder")
  - align equals signs in consecutive assignment statements
  - update copyright year ranges
  - annotate "end" statements for classes and modules
  - make private methods private

Signed-off-by: Wincent Colaiuta <win@wincent.com>
Use lazy-initialization in controller

We now have three finders (file, buffer and jumplist), so it's starting
to smell to create them all up front, especially given that some users
won't ever use anything other than the file finder.

So, switch to lazy initialization.

Signed-off-by: Wincent Colaiuta <win@wincent.com>
Refactor "redir" code to use new "capture" method

As there are now two places in the code where we have to use "redir" to
capture the output of a Vim command, factor it out into a method that
can be easily reused for that purpose.

Signed-off-by: Wincent Colaiuta <win@wincent.com>
Merge branch 'jump-list'

* jump-list:
  Refactor "redir" code to use new "capture" method
  Use lazy-initialization in controller
  Minor stylistic clean-up for jump finder
  Make it possible to select file from jump list
Update docs for 1.3 release

Signed-off-by: Wincent Colaiuta <win@wincent.com>
Fix CommandTJump under Ruby 1.9.x

The jump scanner pulls in a string jumplist. This worked fine under Ruby
1.8.7, where `String#select` operates in a line-wise fashion. Under Ruby
1.9.x, however, it's a private method and explodes. Using `String#lines`
instead makes things work on both Rubies.

Signed-off-by: Wincent Colaiuta <win@wincent.com>
Update docs for 1.3.1 release

Signed-off-by: Wincent Colaiuta <win@wincent.com>
Update copyright year range in LICENSE file

Signed-off-by: Wincent Colaiuta <win@wincent.com>
Added first version of tag plugin
Moved some functions around