Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Ton van den Heuvel committed Oct 11, 2012
2 parents 09578ac + 07087e1 commit 5fa6bf9
Show file tree
Hide file tree
Showing 12 changed files with 158 additions and 52 deletions.
1 change: 1 addition & 0 deletions .mailmap
Expand Up @@ -2,3 +2,4 @@ Nicolas Alpi <nicolas.alpi@gmail.com> Spyou <nicolas.alpi@gmail.com>
Noon Silk <noonsilk@gmail.com> Noon Silk <noonsilk@gmail.com>
Noon Silk <noonsilk@gmail.com> Noon Silk <superhappyfun@gmail.com>
Sung Pae <sung@metablu.com> guns <sung@metablu.com>
Sung Pae <sung@metablu.com> guns <self@sungpae.com>
6 changes: 3 additions & 3 deletions Rakefile
Expand Up @@ -86,7 +86,7 @@ The general release sequence is:
rake prerelease
rake gem
rake push
bin/rake upload:all
bundle exec rake upload:all
rake archive
Most of the Rake tasks run fine without Bundler, and in fact, we
Expand All @@ -101,13 +101,13 @@ end

task :check_bundler do
unless ENV.has_key? 'BUNDLE_GEMFILE'
warn 'warning: Bundler is not loaded; try running with bin/rake'
warn 'warning: Bundler is not loaded; try running with `bundle exec rake`'
end
end

desc 'Run specs'
task :spec do
system 'bin/rspec spec'
system 'bundle exec rspec spec'
bail_on_failure
end

Expand Down
74 changes: 53 additions & 21 deletions doc/command-t.txt
Expand Up @@ -148,11 +148,27 @@ you can build the extension with:
ruby extconf.rb
make

Note: If you are an RVM user, you must perform the build using the same
version of Ruby that Vim itself is linked against. This will often be the
system Ruby, which can be selected before issuing the "make" command with:
Note: If you are an RVM or rbenv user, you must perform the build using the
same version of Ruby that Vim itself is linked against. This will often be the
system Ruby, which can be selected before issuing the "make" command with one
of the following commands:

rvm use system
rbenv local system

Note: Make sure you compile targeting the same architecture Vim was built for.
For instance, MacVim binaries are built for i386, but sometimes GCC compiles
for x86_64. First you have to check the platform Vim was built for:

vim --version
...
Compilation: gcc ... -arch i386 ...
...

and make sure you use the correct ARCHFLAGS during compilation:

export ARCHFLAGS="-arch i386"
make


MANAGING USING PATHOGEN *command-t-pathogen*
Expand Down Expand Up @@ -190,9 +206,9 @@ Or you can switch to a specific release with:

After installing or updating you must build the extension:

cd ~/.vim/bundle/command-t
bundle install
rake make
cd ~/.vim/bundle/command-t/ruby/command-t
ruby extconf.rb
make

While the Vimball installation automatically generates the help tags, under
Pathogen it is necessary to do so explicitly from inside Vim:
Expand Down Expand Up @@ -306,6 +322,7 @@ has focus:
<C-k> select previous file in the file listing
<C-p> select previous file in the file listing
<Up> select previous file in the file listing
<C-f> flush the cache (see |:CommandTFlush| for details)
<C-c> cancel (dismisses file listing)

The following is also available on terminals which support it:
Expand Down Expand Up @@ -351,10 +368,12 @@ COMMANDS *command-t-commands*
*:CommandTFlush*
|:CommandTFlush|Instructs the plug-in to flush its path cache, causing
the directory to be rescanned for new or deleted paths
the next time the file window is shown. In addition, all
configuration settings are re-evaluated, causing any
changes made to settings via the |:let| command to be picked
up.
the next time the file window is shown (pressing <C-f> when
a match listing is visible flushes the cache immediately; this
mapping is configurable via the |g:CommandTRefreshMap|
setting). In addition, all configuration settings are
re-evaluated, causing any changes made to settings via the
|:let| command to be picked up.


MAPPINGS *command-t-mappings*
Expand Down Expand Up @@ -572,6 +591,9 @@ Following is a list of all map settings and their defaults:
*g:CommandTClearMap*
|g:CommandTClearMap| <C-u>

*g:CommandTRefreshMap*
|g:CommandTRefreshMap| <C-f>

*g:CommandTCursorLeftMap*
|g:CommandTCursorLeftMap| <Left>
<C-h>
Expand Down Expand Up @@ -613,16 +635,16 @@ Command-T is written and maintained by Wincent Colaiuta <win@wincent.com>.
Other contributors that have submitted patches include (in alphabetical
order):

Anthony Panozzo Nadav Samet
Daniel Hahler Noon Silk
Gary Bernhardt Rainux Luo
Jeff Kreeftmeijer Scott Bronson
Lucas de Vries Seth Fowler
Marian Schubert Steven Moazami
Matthew Todd Sung Pae
Mike Lundy Victor Hugo Borja
Nate Kane Woody Peterson
Nicholas Alpi Zak Johnson
Anthony Panozzo Mike Lundy Thomas Pelletier
Daniel Hahler Nate Kane Victor Hugo Borja
Felix Tjandrawibawa Nicholas Alpi Woody Peterson
Gary Bernhardt Nadav Samet Yan Pritzker
Ivan Ukhov Noon Silk Zak Johnson
Jeff Kreeftmeijer Rainux Luo
Lucas de Vries Scott Bronson
Marcus Brito Seth Fowler
Marian Schubert Steven Moazami
Matthew Todd Sung Pae

As this was the first Vim plug-in I had ever written I was heavily influenced
by the design of the LustyExplorer plug-in by Stephen Bach, which I understand
Expand Down Expand Up @@ -725,13 +747,23 @@ POSSIBILITY OF SUCH DAMAGE.

HISTORY *command-t-history*

1.4 (not yet released)
1.5 (not yet released)
- don't scan "pathological" filesystem structures (ie. circular or
self-referential symlinks; patch from Marcus Brito)
- gracefully handle files starting with "+" (patch from Ivan Ukhov)

1.4 (20 June 2012)

- added |:CommandTTag| command (patches from Noon Silk)
- turn off |'colorcolumn'| and |'relativenumber'| in the match window (patch
from Jeff Kreeftmeijer)
- documentation update (patch from Nicholas Alpi)
- added |:CommandTMinHeight| option (patch from Nate Kane)
- highlight (by underlining) matched characters in the match listing (requires
Vim to have been compiled with the +conceal feature, which is available in
Vim 7.3 or later; patch from Steven Moazami)
- added the ability to flush the cache while the match window is open using
<C-f>

1.3.1 (18 December 2011)

Expand Down
2 changes: 1 addition & 1 deletion multi-spec.sh
Expand Up @@ -15,7 +15,7 @@ for RUBY_VERSION in $(ls ~/.multiruby/install); do
export PATH=~/.multiruby/install/$RUBY_VERSION/bin:$OLD_PATH
build_quietly
echo "$RUBY_VERSION: running spec suite"
bin/rspec spec
bundle exec rspec spec
echo "$RUBY_VERSION: finished"
done

Expand Down
4 changes: 4 additions & 0 deletions plugin/command-t.vim
Expand Up @@ -120,6 +120,10 @@ function CommandTAcceptSelectionVSplit()
ruby $command_t.accept_selection :command => 'vs'
endfunction

function CommandTRefresh()
ruby $command_t.refresh
endfunction

function CommandTToggleFocus()
ruby $command_t.toggle_focus
endfunction
Expand Down
24 changes: 17 additions & 7 deletions ruby/command-t/controller.rb
Expand Up @@ -80,6 +80,12 @@ def hide
end
end

def refresh
return unless @active_finder && @active_finder.respond_to?(:flush)
@active_finder.flush
list_matches
end

def flush
@max_height = nil
@min_height = nil
Expand Down Expand Up @@ -255,6 +261,7 @@ def open_selection selection, options = {}
selection = File.expand_path selection, @path
selection = relative_path_under_working_directory selection
selection = sanitize_path_string selection
selection = File.join('.', selection) if selection =~ /^\+/
ensure_appropriate_window_selection

@active_finder.open_selection command, selection, options
Expand All @@ -280,21 +287,24 @@ def register_for_key_presses
end

# "special" keys (overridable by settings)
{ 'Backspace' => '<BS>',
'Delete' => '<Del>',
{
'AcceptSelection' => '<CR>',
'AcceptSelectionSplit' => ['<C-CR>', '<C-s>'],
'AcceptSelectionTab' => '<C-t>',
'AcceptSelectionVSplit' => '<C-v>',
'ToggleFocus' => '<Tab>',
'Backspace' => '<BS>',
'Cancel' => ['<C-c>', '<Esc>'],
'SelectNext' => ['<C-n>', '<C-j>', '<Down>'],
'SelectPrev' => ['<C-p>', '<C-k>', '<Up>'],
'Clear' => '<C-u>',
'CursorEnd' => '<C-e>',
'CursorLeft' => ['<Left>', '<C-h>'],
'CursorRight' => ['<Right>', '<C-l>'],
'CursorEnd' => '<C-e>',
'CursorStart' => '<C-a>' }.each do |key, value|
'CursorStart' => '<C-a>',
'Delete' => '<Del>',
'Refresh' => '<C-f>',
'SelectNext' => ['<C-n>', '<C-j>', '<Down>'],
'SelectPrev' => ['<C-p>', '<C-k>', '<Up>'],
'ToggleFocus' => '<Tab>',
}.each do |key, value|
if override = get_list_or_string("g:CommandT#{key}Map")
Array(override).each do |mapping|
map mapping, key
Expand Down
4 changes: 0 additions & 4 deletions ruby/command-t/finder.rb
Expand Up @@ -43,10 +43,6 @@ def sorted_matches_for str, options = {}
@matcher.sorted_matches_for str, options
end

def flush
@scanner.flush
end

def open_selection command, selection, options = {}
::VIM::command "silent #{command} #{selection}"
end
Expand Down
6 changes: 5 additions & 1 deletion ruby/command-t/finder/file_finder.rb
@@ -1,4 +1,4 @@
# Copyright 2010-2011 Wincent Colaiuta. All rights reserved.
# Copyright 2010-2012 Wincent Colaiuta. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
Expand Down Expand Up @@ -31,5 +31,9 @@ def initialize path = Dir.pwd, options = {}
@scanner = FileScanner.new path, options
@matcher = Matcher.new @scanner, options
end

def flush
@scanner.flush
end
end # class FileFinder
end # CommandT

0 comments on commit 5fa6bf9

Please sign in to comment.