command-t 1.3.1 → 1.4

Sign up to get free protection for your applications and to get access to all the features.
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright 2010-2011 Wincent Colaiuta. All rights reserved.
1
+ Copyright 2010-2012 Wincent Colaiuta. All rights reserved.
2
2
 
3
3
  Redistribution and use in source and binary forms, with or without
4
4
  modification, are permitted provided that the following conditions are met:
data/README.txt CHANGED
@@ -12,10 +12,11 @@ CONTENTS *command-t-contents*
12
12
  7. Mappings |command-t-mappings|
13
13
  8. Options |command-t-options|
14
14
  9. Authors |command-t-authors|
15
- 10. Website |command-t-website|
16
- 11. Donations |command-t-donations|
17
- 12. License |command-t-license|
18
- 13. History |command-t-history|
15
+ 10. Development |command-t-development|
16
+ 11. Website |command-t-website|
17
+ 12. Donations |command-t-donations|
18
+ 13. License |command-t-license|
19
+ 14. History |command-t-history|
19
20
 
20
21
 
21
22
  INTRODUCTION *command-t-intro*
@@ -147,11 +148,27 @@ you can build the extension with:
147
148
  ruby extconf.rb
148
149
  make
149
150
 
150
- Note: If you are an RVM user, you must perform the build using the same
151
- version of Ruby that Vim itself is linked against. This will often be the
152
- system Ruby, which can be selected before issuing the "make" command with:
151
+ Note: If you are an RVM or rbenv user, you must perform the build using the
152
+ same version of Ruby that Vim itself is linked against. This will often be the
153
+ system Ruby, which can be selected before issuing the "make" command with one
154
+ of the following commands:
153
155
 
154
156
  rvm use system
157
+ rbenv local system
158
+
159
+ Note: Make sure you compile targeting the same architecture Vim was built for.
160
+ For instance, MacVim binaries are built for i386, but sometimes GCC compiles
161
+ for x86_64. First you have to check the platfom Vim was built for:
162
+
163
+ vim --version
164
+ ...
165
+ Compilation: gcc ... -arch i386 ...
166
+ ...
167
+
168
+ and make sure you use the correct ARCHFLAGS during compilation:
169
+
170
+ export ARCHFLAGS="-arch i386"
171
+ make
155
172
 
156
173
 
157
174
  MANAGING USING PATHOGEN *command-t-pathogen*
@@ -190,6 +207,7 @@ Or you can switch to a specific release with:
190
207
  After installing or updating you must build the extension:
191
208
 
192
209
  cd ~/.vim/bundle/command-t
210
+ bundle install
193
211
  rake make
194
212
 
195
213
  While the Vimball installation automatically generates the help tags, under
@@ -304,6 +322,7 @@ has focus:
304
322
  <C-k> select previous file in the file listing
305
323
  <C-p> select previous file in the file listing
306
324
  <Up> select previous file in the file listing
325
+ <C-f> flush the cache (see |:CommandTFlush| for details)
307
326
  <C-c> cancel (dismisses file listing)
308
327
 
309
328
  The following is also available on terminals which support it:
@@ -340,13 +359,21 @@ COMMANDS *command-t-commands*
340
359
  can persist across Vim sessions (see Vim's |jumplist|
341
360
  documentation for more info).
342
361
 
362
+ *:CommandTTag*
363
+ |:CommandTTag| Brings up the Command-T window tags window, which can
364
+ be used to select from the tags, if any, returned by
365
+ Vim's |taglist()| function. See Vim's |tag| documentation
366
+ for general info on tags.
367
+
343
368
  *:CommandTFlush*
344
369
  |:CommandTFlush|Instructs the plug-in to flush its path cache, causing
345
370
  the directory to be rescanned for new or deleted paths
346
- the next time the file window is shown. In addition, all
347
- configuration settings are re-evaluated, causing any
348
- changes made to settings via the |:let| command to be picked
349
- up.
371
+ the next time the file window is shown (pressing <C-f> when
372
+ a match listing is visible flushes the cache immediately; this
373
+ mapping is configurable via the |g:CommandTRefreshMap|
374
+ setting). In addition, all configuration settings are
375
+ re-evaluated, causing any changes made to settings via the
376
+ |:let| command to be picked up.
350
377
 
351
378
 
352
379
  MAPPINGS *command-t-mappings*
@@ -424,6 +451,13 @@ Following is a list of all available options:
424
451
  If set to 0, the window will occupy as much of the available space as
425
452
  needed to show matching entries.
426
453
 
454
+ *g:CommandTMinHeight*
455
+ |g:CommandTMinHeight| number (default: 0)
456
+
457
+ The minimum height in lines the match window is allowed to shrink to.
458
+ If set to 0, will default to a single line. If set above the max height,
459
+ will default to |g:CommandTMaxHeight|.
460
+
427
461
  *g:CommandTAlwaysShowDotFiles*
428
462
  |g:CommandTAlwaysShowDotFiles| boolean (default: 0)
429
463
 
@@ -488,6 +522,12 @@ Following is a list of all available options:
488
522
  you want the best match to appear in a fixed location on the screen
489
523
  but still be near the prompt at the bottom.
490
524
 
525
+ *g:CommandTTagIncludeFilenames*
526
+ |g:CommandTTagIncludeFilenames| boolean (default: 0)
527
+
528
+ When this setting is off (the default) the matches in the |:CommandTTag|
529
+ listing do not include filenames.
530
+
491
531
  As well as the basic options listed above, there are a number of settings that
492
532
  can be used to override the default key mappings used by Command-T. For
493
533
  example, to set <C-x> as the mapping for cancelling (dismissing) the Command-T
@@ -542,6 +582,9 @@ Following is a list of all map settings and their defaults:
542
582
  *g:CommandTClearMap*
543
583
  |g:CommandTClearMap| <C-u>
544
584
 
585
+ *g:CommandTRefreshMap*
586
+ |g:CommandTRefreshMap| <C-f>
587
+
545
588
  *g:CommandTCursorLeftMap*
546
589
  |g:CommandTCursorLeftMap| <Left>
547
590
  <C-h>
@@ -583,18 +626,14 @@ Command-T is written and maintained by Wincent Colaiuta <win@wincent.com>.
583
626
  Other contributors that have submitted patches include (in alphabetical
584
627
  order):
585
628
 
586
- Anthony Panozzo
587
- Daniel Hahler
588
- Lucas de Vries
589
- Marian Schubert
590
- Matthew Todd
591
- Mike Lundy
592
- Scott Bronson
593
- Steven Moazami
594
- Sung Pae
595
- Victor Hugo Borja
596
- Woody Peterson
597
- Zak Johnson
629
+ Anthony Panozzo Mike Lundy Steven Moazami
630
+ Daniel Hahler Nate Kane Sung Pae
631
+ Felix Tjandrawibawa Nicholas Alpi Thomas Pelletier
632
+ Gary Bernhardt Nadav Samet Victor Hugo Borja
633
+ Jeff Kreeftmeijer Noon Silk Woody Peterson
634
+ Lucas de Vries Rainux Luo Yan Pritzker
635
+ Marian Schubert Scott Bronson Zak Johnson
636
+ Matthew Todd Seth Fowler
598
637
 
599
638
  As this was the first Vim plug-in I had ever written I was heavily influenced
600
639
  by the design of the LustyExplorer plug-in by Stephen Bach, which I understand
@@ -611,6 +650,38 @@ LustyExplorer is available from:
611
650
  http://www.vim.org/scripts/script.php?script_id=1890
612
651
 
613
652
 
653
+ DEVELOPMENT *command-t-development*
654
+
655
+ Development in progress can be inspected via the project's Git web-based
656
+ repository browser at:
657
+
658
+ https://wincent.com/repos/command-t
659
+
660
+ the clone URL for which is:
661
+
662
+ git://git.wincent.com/command-t.git
663
+
664
+ Mirrors exist on GitHub and Gitorious; these are automatically updated once
665
+ per hour from the authoritative repository:
666
+
667
+ https://github.com/wincent/command-t
668
+ https://gitorious.org/command-t/command-t
669
+
670
+ Patches are welcome via the usual mechanisms (pull requests, email, posting to
671
+ the project issue tracker etc).
672
+
673
+ As many users choose to track Command-T using Pathogen, which often means
674
+ running a version later than the last official release, the intention is that
675
+ the "master" branch should be kept in a stable and reliable state as much as
676
+ possible.
677
+
678
+ Riskier changes are first cooked on the "next" branch for a period before
679
+ being merged into master. You can track this branch if you're feeling wild and
680
+ experimental, but note that the "next" branch may periodically be rewound
681
+ (force-updated) to keep it in sync with the "master" branch after each
682
+ official release.
683
+
684
+
614
685
  WEBSITE *command-t-website*
615
686
 
616
687
  The official website for Command-T is:
@@ -619,11 +690,6 @@ The official website for Command-T is:
619
690
 
620
691
  The latest release will always be available from there.
621
692
 
622
- Development in progress can be inspected via the project's Git repository
623
- browser at:
624
-
625
- https://wincent.com/repos/command-t
626
-
627
693
  A copy of each release is also available from the official Vim scripts site
628
694
  at:
629
695
 
@@ -645,7 +711,7 @@ PayPal to win@wincent.com:
645
711
 
646
712
  LICENSE *command-t-license*
647
713
 
648
- Copyright 2010-2011 Wincent Colaiuta. All rights reserved.
714
+ Copyright 2010-2012 Wincent Colaiuta. All rights reserved.
649
715
 
650
716
  Redistribution and use in source and binary forms, with or without
651
717
  modification, are permitted provided that the following conditions are met:
@@ -670,6 +736,19 @@ POSSIBILITY OF SUCH DAMAGE.
670
736
 
671
737
  HISTORY *command-t-history*
672
738
 
739
+ 1.4 (20 June 2012)
740
+
741
+ - added |:CommandTTag| command (patches from Noon Silk)
742
+ - turn off |'colorcolumn'| and |'relativenumber'| in the match window (patch
743
+ from Jeff Kreeftmeijer)
744
+ - documentation update (patch from Nicholas Alpi)
745
+ - added |:CommandTMinHeight| option (patch from Nate Kane)
746
+ - highlight (by underlining) matched characters in the match listing (requires
747
+ Vim to have been compiled with the +conceal feature, which is available in
748
+ Vim 7.3 or later; patch from Steven Moazami)
749
+ - added the ability to flush the cache while the match window is open using
750
+ <C-f>
751
+
673
752
  1.3.1 (18 December 2011)
674
753
 
675
754
  - fix jumplist navigation under Ruby 1.9.x (patch from Woody Peterson)
data/Rakefile CHANGED
@@ -86,7 +86,7 @@ The general release sequence is:
86
86
  rake prerelease
87
87
  rake gem
88
88
  rake push
89
- bin/rake upload:all
89
+ bundle exec rake upload:all
90
90
  rake archive
91
91
 
92
92
  Most of the Rake tasks run fine without Bundler, and in fact, we
@@ -101,13 +101,13 @@ end
101
101
 
102
102
  task :check_bundler do
103
103
  unless ENV.has_key? 'BUNDLE_GEMFILE'
104
- warn 'warning: Bundler is not loaded; try running with bin/rake'
104
+ warn 'warning: Bundler is not loaded; try running with `bundle exec rake`'
105
105
  end
106
106
  end
107
107
 
108
108
  desc 'Run specs'
109
109
  task :spec do
110
- system 'bin/rspec spec'
110
+ system 'bundle exec rspec spec'
111
111
  bail_on_failure
112
112
  end
113
113
 
@@ -121,7 +121,8 @@ end
121
121
  desc 'Clean compiled products'
122
122
  task :clean do
123
123
  Dir.chdir 'ruby/command-t' do
124
- system 'make clean'
124
+ system 'make clean' if File.exists?('Makefile')
125
+ system 'rm -f Makefile'
125
126
  end
126
127
  end
127
128
 
data/doc/command-t.txt CHANGED
@@ -12,10 +12,11 @@ CONTENTS *command-t-contents*
12
12
  7. Mappings |command-t-mappings|
13
13
  8. Options |command-t-options|
14
14
  9. Authors |command-t-authors|
15
- 10. Website |command-t-website|
16
- 11. Donations |command-t-donations|
17
- 12. License |command-t-license|
18
- 13. History |command-t-history|
15
+ 10. Development |command-t-development|
16
+ 11. Website |command-t-website|
17
+ 12. Donations |command-t-donations|
18
+ 13. License |command-t-license|
19
+ 14. History |command-t-history|
19
20
 
20
21
 
21
22
  INTRODUCTION *command-t-intro*
@@ -147,11 +148,27 @@ you can build the extension with:
147
148
  ruby extconf.rb
148
149
  make
149
150
 
150
- Note: If you are an RVM user, you must perform the build using the same
151
- version of Ruby that Vim itself is linked against. This will often be the
152
- system Ruby, which can be selected before issuing the "make" command with:
151
+ Note: If you are an RVM or rbenv user, you must perform the build using the
152
+ same version of Ruby that Vim itself is linked against. This will often be the
153
+ system Ruby, which can be selected before issuing the "make" command with one
154
+ of the following commands:
153
155
 
154
156
  rvm use system
157
+ rbenv local system
158
+
159
+ Note: Make sure you compile targeting the same architecture Vim was built for.
160
+ For instance, MacVim binaries are built for i386, but sometimes GCC compiles
161
+ for x86_64. First you have to check the platfom Vim was built for:
162
+
163
+ vim --version
164
+ ...
165
+ Compilation: gcc ... -arch i386 ...
166
+ ...
167
+
168
+ and make sure you use the correct ARCHFLAGS during compilation:
169
+
170
+ export ARCHFLAGS="-arch i386"
171
+ make
155
172
 
156
173
 
157
174
  MANAGING USING PATHOGEN *command-t-pathogen*
@@ -190,6 +207,7 @@ Or you can switch to a specific release with:
190
207
  After installing or updating you must build the extension:
191
208
 
192
209
  cd ~/.vim/bundle/command-t
210
+ bundle install
193
211
  rake make
194
212
 
195
213
  While the Vimball installation automatically generates the help tags, under
@@ -304,6 +322,7 @@ has focus:
304
322
  <C-k> select previous file in the file listing
305
323
  <C-p> select previous file in the file listing
306
324
  <Up> select previous file in the file listing
325
+ <C-f> flush the cache (see |:CommandTFlush| for details)
307
326
  <C-c> cancel (dismisses file listing)
308
327
 
309
328
  The following is also available on terminals which support it:
@@ -340,13 +359,21 @@ COMMANDS *command-t-commands*
340
359
  can persist across Vim sessions (see Vim's |jumplist|
341
360
  documentation for more info).
342
361
 
362
+ *:CommandTTag*
363
+ |:CommandTTag| Brings up the Command-T window tags window, which can
364
+ be used to select from the tags, if any, returned by
365
+ Vim's |taglist()| function. See Vim's |tag| documentation
366
+ for general info on tags.
367
+
343
368
  *:CommandTFlush*
344
369
  |:CommandTFlush|Instructs the plug-in to flush its path cache, causing
345
370
  the directory to be rescanned for new or deleted paths
346
- the next time the file window is shown. In addition, all
347
- configuration settings are re-evaluated, causing any
348
- changes made to settings via the |:let| command to be picked
349
- up.
371
+ the next time the file window is shown (pressing <C-f> when
372
+ a match listing is visible flushes the cache immediately; this
373
+ mapping is configurable via the |g:CommandTRefreshMap|
374
+ setting). In addition, all configuration settings are
375
+ re-evaluated, causing any changes made to settings via the
376
+ |:let| command to be picked up.
350
377
 
351
378
 
352
379
  MAPPINGS *command-t-mappings*
@@ -424,6 +451,13 @@ Following is a list of all available options:
424
451
  If set to 0, the window will occupy as much of the available space as
425
452
  needed to show matching entries.
426
453
 
454
+ *g:CommandTMinHeight*
455
+ |g:CommandTMinHeight| number (default: 0)
456
+
457
+ The minimum height in lines the match window is allowed to shrink to.
458
+ If set to 0, will default to a single line. If set above the max height,
459
+ will default to |g:CommandTMaxHeight|.
460
+
427
461
  *g:CommandTAlwaysShowDotFiles*
428
462
  |g:CommandTAlwaysShowDotFiles| boolean (default: 0)
429
463
 
@@ -488,6 +522,12 @@ Following is a list of all available options:
488
522
  you want the best match to appear in a fixed location on the screen
489
523
  but still be near the prompt at the bottom.
490
524
 
525
+ *g:CommandTTagIncludeFilenames*
526
+ |g:CommandTTagIncludeFilenames| boolean (default: 0)
527
+
528
+ When this setting is off (the default) the matches in the |:CommandTTag|
529
+ listing do not include filenames.
530
+
491
531
  As well as the basic options listed above, there are a number of settings that
492
532
  can be used to override the default key mappings used by Command-T. For
493
533
  example, to set <C-x> as the mapping for cancelling (dismissing) the Command-T
@@ -542,6 +582,9 @@ Following is a list of all map settings and their defaults:
542
582
  *g:CommandTClearMap*
543
583
  |g:CommandTClearMap| <C-u>
544
584
 
585
+ *g:CommandTRefreshMap*
586
+ |g:CommandTRefreshMap| <C-f>
587
+
545
588
  *g:CommandTCursorLeftMap*
546
589
  |g:CommandTCursorLeftMap| <Left>
547
590
  <C-h>
@@ -583,18 +626,14 @@ Command-T is written and maintained by Wincent Colaiuta <win@wincent.com>.
583
626
  Other contributors that have submitted patches include (in alphabetical
584
627
  order):
585
628
 
586
- Anthony Panozzo
587
- Daniel Hahler
588
- Lucas de Vries
589
- Marian Schubert
590
- Matthew Todd
591
- Mike Lundy
592
- Scott Bronson
593
- Steven Moazami
594
- Sung Pae
595
- Victor Hugo Borja
596
- Woody Peterson
597
- Zak Johnson
629
+ Anthony Panozzo Mike Lundy Steven Moazami
630
+ Daniel Hahler Nate Kane Sung Pae
631
+ Felix Tjandrawibawa Nicholas Alpi Thomas Pelletier
632
+ Gary Bernhardt Nadav Samet Victor Hugo Borja
633
+ Jeff Kreeftmeijer Noon Silk Woody Peterson
634
+ Lucas de Vries Rainux Luo Yan Pritzker
635
+ Marian Schubert Scott Bronson Zak Johnson
636
+ Matthew Todd Seth Fowler
598
637
 
599
638
  As this was the first Vim plug-in I had ever written I was heavily influenced
600
639
  by the design of the LustyExplorer plug-in by Stephen Bach, which I understand
@@ -611,6 +650,38 @@ LustyExplorer is available from:
611
650
  http://www.vim.org/scripts/script.php?script_id=1890
612
651
 
613
652
 
653
+ DEVELOPMENT *command-t-development*
654
+
655
+ Development in progress can be inspected via the project's Git web-based
656
+ repository browser at:
657
+
658
+ https://wincent.com/repos/command-t
659
+
660
+ the clone URL for which is:
661
+
662
+ git://git.wincent.com/command-t.git
663
+
664
+ Mirrors exist on GitHub and Gitorious; these are automatically updated once
665
+ per hour from the authoritative repository:
666
+
667
+ https://github.com/wincent/command-t
668
+ https://gitorious.org/command-t/command-t
669
+
670
+ Patches are welcome via the usual mechanisms (pull requests, email, posting to
671
+ the project issue tracker etc).
672
+
673
+ As many users choose to track Command-T using Pathogen, which often means
674
+ running a version later than the last official release, the intention is that
675
+ the "master" branch should be kept in a stable and reliable state as much as
676
+ possible.
677
+
678
+ Riskier changes are first cooked on the "next" branch for a period before
679
+ being merged into master. You can track this branch if you're feeling wild and
680
+ experimental, but note that the "next" branch may periodically be rewound
681
+ (force-updated) to keep it in sync with the "master" branch after each
682
+ official release.
683
+
684
+
614
685
  WEBSITE *command-t-website*
615
686
 
616
687
  The official website for Command-T is:
@@ -619,11 +690,6 @@ The official website for Command-T is:
619
690
 
620
691
  The latest release will always be available from there.
621
692
 
622
- Development in progress can be inspected via the project's Git repository
623
- browser at:
624
-
625
- https://wincent.com/repos/command-t
626
-
627
693
  A copy of each release is also available from the official Vim scripts site
628
694
  at:
629
695
 
@@ -645,7 +711,7 @@ PayPal to win@wincent.com:
645
711
 
646
712
  LICENSE *command-t-license*
647
713
 
648
- Copyright 2010-2011 Wincent Colaiuta. All rights reserved.
714
+ Copyright 2010-2012 Wincent Colaiuta. All rights reserved.
649
715
 
650
716
  Redistribution and use in source and binary forms, with or without
651
717
  modification, are permitted provided that the following conditions are met:
@@ -670,6 +736,19 @@ POSSIBILITY OF SUCH DAMAGE.
670
736
 
671
737
  HISTORY *command-t-history*
672
738
 
739
+ 1.4 (20 June 2012)
740
+
741
+ - added |:CommandTTag| command (patches from Noon Silk)
742
+ - turn off |'colorcolumn'| and |'relativenumber'| in the match window (patch
743
+ from Jeff Kreeftmeijer)
744
+ - documentation update (patch from Nicholas Alpi)
745
+ - added |:CommandTMinHeight| option (patch from Nate Kane)
746
+ - highlight (by underlining) matched characters in the match listing (requires
747
+ Vim to have been compiled with the +conceal feature, which is available in
748
+ Vim 7.3 or later; patch from Steven Moazami)
749
+ - added the ability to flush the cache while the match window is open using
750
+ <C-f>
751
+
673
752
  1.3.1 (18 December 2011)
674
753
 
675
754
  - fix jumplist navigation under Ruby 1.9.x (patch from Woody Peterson)
data/plugin/command-t.vim CHANGED
@@ -1,5 +1,5 @@
1
1
  " command-t.vim
2
- " Copyright 2010-2011 Wincent Colaiuta. All rights reserved.
2
+ " Copyright 2010-2012 Wincent Colaiuta. All rights reserved.
3
3
  "
4
4
  " Redistribution and use in source and binary forms, with or without
5
5
  " modification, are permitted provided that the following conditions are met:
@@ -22,13 +22,14 @@
22
22
  " ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
23
23
  " POSSIBILITY OF SUCH DAMAGE.
24
24
 
25
- if exists("g:command_t_loaded")
25
+ if exists("g:command_t_loaded") || &cp
26
26
  finish
27
27
  endif
28
28
  let g:command_t_loaded = 1
29
29
 
30
30
  command CommandTBuffer call <SID>CommandTShowBufferFinder()
31
31
  command CommandTJump call <SID>CommandTShowJumpFinder()
32
+ command CommandTTag call <SID>CommandTShowTagFinder()
32
33
  command -nargs=? -complete=dir CommandT call <SID>CommandTShowFileFinder(<q-args>)
33
34
  command CommandTFlush call <SID>CommandTFlush()
34
35
 
@@ -71,6 +72,14 @@ function s:CommandTShowJumpFinder()
71
72
  endif
72
73
  endfunction
73
74
 
75
+ function s:CommandTShowTagFinder()
76
+ if has('ruby')
77
+ ruby $command_t.show_tag_finder
78
+ else
79
+ call s:CommandTRubyWarning()
80
+ endif
81
+ endfunction
82
+
74
83
  function s:CommandTFlush()
75
84
  if has('ruby')
76
85
  ruby $command_t.flush
@@ -111,6 +120,10 @@ function CommandTAcceptSelectionVSplit()
111
120
  ruby $command_t.accept_selection :command => 'vs'
112
121
  endfunction
113
122
 
123
+ function CommandTRefresh()
124
+ ruby $command_t.refresh
125
+ endfunction
126
+
114
127
  function CommandTToggleFocus()
115
128
  ruby $command_t.toggle_focus
116
129
  endfunction
@@ -4,23 +4,23 @@ SHELL = /bin/sh
4
4
  #### Start of system configuration section. ####
5
5
 
6
6
  srcdir = .
7
- topdir = /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin11.0
7
+ topdir = /Users/greg/.multiruby/install/1.8.7-p334/lib/ruby/1.8/i686-darwin10.6.0
8
8
  hdrdir = $(topdir)
9
9
  VPATH = $(srcdir):$(topdir):$(hdrdir)
10
10
  exec_prefix = $(prefix)
11
- prefix = $(DESTDIR)/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr
11
+ prefix = $(DESTDIR)/Users/greg/.multiruby/install/1.8.7-p334
12
12
  sharedstatedir = $(prefix)/com
13
- mandir = $(DESTDIR)/usr/share/man
13
+ mandir = $(datarootdir)/man
14
14
  psdir = $(docdir)
15
15
  oldincludedir = $(DESTDIR)/usr/include
16
16
  localedir = $(datarootdir)/locale
17
17
  bindir = $(exec_prefix)/bin
18
18
  libexecdir = $(exec_prefix)/libexec
19
- sitedir = $(DESTDIR)/Library/Ruby/Site
19
+ sitedir = $(libdir)/ruby/site_ruby
20
20
  htmldir = $(docdir)
21
21
  vendorarchdir = $(vendorlibdir)/$(sitearch)
22
22
  includedir = $(prefix)/include
23
- infodir = $(DESTDIR)/usr/share/info
23
+ infodir = $(datarootdir)/info
24
24
  vendorlibdir = $(vendordir)/$(ruby_version)
25
25
  sysconfdir = $(prefix)/etc
26
26
  libdir = $(exec_prefix)/lib
@@ -41,28 +41,28 @@ CC = gcc
41
41
  LIBRUBY = $(LIBRUBY_SO)
42
42
  LIBRUBY_A = lib$(RUBY_SO_NAME)-static.a
43
43
  LIBRUBYARG_SHARED = -l$(RUBY_SO_NAME)
44
- LIBRUBYARG_STATIC = -l$(RUBY_SO_NAME)
44
+ LIBRUBYARG_STATIC = -l$(RUBY_SO_NAME)-static
45
45
 
46
46
  RUBY_EXTCONF_H =
47
- CFLAGS = -fno-common -arch i386 -arch x86_64 -g -Os -pipe -fno-common -DENABLE_DTRACE -fno-common -pipe -fno-common $(cflags)
47
+ CFLAGS = -fno-common -g -O2 -fno-common -pipe -fno-common $(cflags)
48
48
  INCFLAGS = -I. -I$(topdir) -I$(hdrdir) -I$(srcdir)
49
49
  DEFS =
50
50
  CPPFLAGS = -DHAVE_RUBY_H -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE $(DEFS) $(cppflags)
51
51
  CXXFLAGS = $(CFLAGS)
52
- ldflags = -L. -arch i386 -arch x86_64
52
+ ldflags = -L.
53
53
  dldflags =
54
54
  archflag =
55
55
  DLDFLAGS = $(ldflags) $(dldflags) $(archflag)
56
- LDSHARED = cc -arch i386 -arch x86_64 -pipe -bundle -undefined dynamic_lookup
56
+ LDSHARED = cc -dynamic -bundle -undefined suppress -flat_namespace
57
57
  AR = ar
58
58
  EXEEXT =
59
59
 
60
60
  RUBY_INSTALL_NAME = ruby
61
61
  RUBY_SO_NAME = ruby
62
- arch = universal-darwin11.0
63
- sitearch = universal-darwin11.0
62
+ arch = i686-darwin10.6.0
63
+ sitearch = i686-darwin10.6.0
64
64
  ruby_version = 1.8
65
- ruby = /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
65
+ ruby = /Users/greg/.multiruby/install/1.8.7-p334/bin/ruby
66
66
  RUBY = $(ruby)
67
67
  RM = rm -f
68
68
  MAKEDIRS = mkdir -p
@@ -86,7 +86,7 @@ extout =
86
86
  extout_prefix =
87
87
  target_prefix =
88
88
  LOCAL_LIBS =
89
- LIBS = $(LIBRUBYARG_SHARED) -lpthread -ldl
89
+ LIBS = $(LIBRUBYARG_SHARED) -ldl -lobjc
90
90
  SRCS = ext.c match.c matcher.c
91
91
  OBJS = ext.o match.o matcher.o
92
92
  TARGET = ext
@@ -1,4 +1,4 @@
1
- # Copyright 2010-2011 Wincent Colaiuta. All rights reserved.
1
+ # Copyright 2010-2012 Wincent Colaiuta. All rights reserved.
2
2
  #
3
3
  # Redistribution and use in source and binary forms, with or without
4
4
  # modification, are permitted provided that the following conditions are met:
@@ -24,6 +24,7 @@
24
24
  require 'command-t/finder/buffer_finder'
25
25
  require 'command-t/finder/jump_finder'
26
26
  require 'command-t/finder/file_finder'
27
+ require 'command-t/finder/tag_finder'
27
28
  require 'command-t/match_window'
28
29
  require 'command-t/prompt'
29
30
  require 'command-t/vim/path_utilities'
@@ -48,6 +49,12 @@ module CommandT
48
49
  show
49
50
  end
50
51
 
52
+ def show_tag_finder
53
+ @path = VIM::pwd
54
+ @active_finder = tag_finder
55
+ show
56
+ end
57
+
51
58
  def show_file_finder
52
59
  # optional parameter will be desired starting directory, or ""
53
60
  @path = File.expand_path(::VIM::evaluate('a:arg'), VIM::pwd)
@@ -72,9 +79,17 @@ module CommandT
72
79
  end
73
80
  end
74
81
 
82
+ def refresh
83
+ return unless @active_finder && @active_finder.respond_to?(:flush)
84
+ @active_finder.flush
85
+ list_matches
86
+ end
87
+
75
88
  def flush
76
89
  @max_height = nil
90
+ @min_height = nil
77
91
  @file_finder = nil
92
+ @tag_finder = nil
78
93
  end
79
94
 
80
95
  def handle_key
@@ -162,7 +177,8 @@ module CommandT
162
177
  @match_window = MatchWindow.new \
163
178
  :prompt => @prompt,
164
179
  :match_window_at_top => get_bool('g:CommandTMatchWindowAtTop'),
165
- :match_window_reverse => get_bool('g:CommandTMatchWindowReverse')
180
+ :match_window_reverse => get_bool('g:CommandTMatchWindowReverse'),
181
+ :min_height => min_height
166
182
  @focus = @prompt
167
183
  @prompt.focus
168
184
  register_for_key_presses
@@ -173,25 +189,29 @@ module CommandT
173
189
  @max_height ||= get_number('g:CommandTMaxHeight') || 0
174
190
  end
175
191
 
176
- def exists? name
177
- ::VIM::evaluate("exists(\"#{name}\")").to_i != 0
192
+ def min_height
193
+ @min_height ||= begin
194
+ min_height = get_number('g:CommandTMinHeight') || 0
195
+ min_height = max_height if max_height != 0 && min_height > max_height
196
+ min_height
197
+ end
178
198
  end
179
199
 
180
200
  def get_number name
181
- exists?(name) ? ::VIM::evaluate("#{name}").to_i : nil
201
+ VIM::exists?(name) ? ::VIM::evaluate("#{name}").to_i : nil
182
202
  end
183
203
 
184
204
  def get_bool name
185
- exists?(name) ? ::VIM::evaluate("#{name}").to_i != 0 : nil
205
+ VIM::exists?(name) ? ::VIM::evaluate("#{name}").to_i != 0 : nil
186
206
  end
187
207
 
188
208
  def get_string name
189
- exists?(name) ? ::VIM::evaluate("#{name}").to_s : nil
209
+ VIM::exists?(name) ? ::VIM::evaluate("#{name}").to_s : nil
190
210
  end
191
211
 
192
212
  # expect a string or a list of strings
193
213
  def get_list_or_string name
194
- return nil unless exists?(name)
214
+ return nil unless VIM::exists?(name)
195
215
  list_or_string = ::VIM::evaluate("#{name}")
196
216
  if list_or_string.kind_of?(Array)
197
217
  list_or_string.map { |item| item.to_s }
@@ -241,7 +261,8 @@ module CommandT
241
261
  selection = relative_path_under_working_directory selection
242
262
  selection = sanitize_path_string selection
243
263
  ensure_appropriate_window_selection
244
- ::VIM::command "silent #{command} #{selection}"
264
+
265
+ @active_finder.open_selection command, selection, options
245
266
  end
246
267
 
247
268
  def map key, function, param = nil
@@ -249,12 +270,8 @@ module CommandT
249
270
  ":call CommandT#{function}(#{param})<CR>"
250
271
  end
251
272
 
252
- def xterm?
253
- !!(::VIM::evaluate('&term') =~ /\Axterm/)
254
- end
255
-
256
- def vt100?
257
- !!(::VIM::evaluate('&term') =~ /\Avt100/)
273
+ def term
274
+ @term ||= ::VIM::evaluate('&term')
258
275
  end
259
276
 
260
277
  def register_for_key_presses
@@ -268,28 +285,33 @@ module CommandT
268
285
  end
269
286
 
270
287
  # "special" keys (overridable by settings)
271
- { 'Backspace' => '<BS>',
272
- 'Delete' => '<Del>',
288
+ {
273
289
  'AcceptSelection' => '<CR>',
274
290
  'AcceptSelectionSplit' => ['<C-CR>', '<C-s>'],
275
291
  'AcceptSelectionTab' => '<C-t>',
276
292
  'AcceptSelectionVSplit' => '<C-v>',
277
- 'ToggleFocus' => '<Tab>',
293
+ 'Backspace' => '<BS>',
278
294
  'Cancel' => ['<C-c>', '<Esc>'],
279
- 'SelectNext' => ['<C-n>', '<C-j>', '<Down>'],
280
- 'SelectPrev' => ['<C-p>', '<C-k>', '<Up>'],
281
295
  'Clear' => '<C-u>',
296
+ 'CursorEnd' => '<C-e>',
282
297
  'CursorLeft' => ['<Left>', '<C-h>'],
283
298
  'CursorRight' => ['<Right>', '<C-l>'],
284
- 'CursorEnd' => '<C-e>',
285
- 'CursorStart' => '<C-a>' }.each do |key, value|
299
+ 'CursorStart' => '<C-a>',
300
+ 'Delete' => '<Del>',
301
+ 'Refresh' => '<C-f>',
302
+ 'SelectNext' => ['<C-n>', '<C-j>', '<Down>'],
303
+ 'SelectPrev' => ['<C-p>', '<C-k>', '<Up>'],
304
+ 'ToggleFocus' => '<Tab>',
305
+ }.each do |key, value|
286
306
  if override = get_list_or_string("g:CommandT#{key}Map")
287
- [override].flatten.each do |mapping|
307
+ Array(override).each do |mapping|
288
308
  map mapping, key
289
309
  end
290
310
  else
291
- [value].flatten.each do |mapping|
292
- map mapping, key unless mapping == '<Esc>' && (xterm? || vt100?)
311
+ Array(value).each do |mapping|
312
+ unless mapping == '<Esc>' && term =~ /\A(screen|xterm|vt100)/
313
+ map mapping, key
314
+ end
293
315
  end
294
316
  end
295
317
  end
@@ -326,5 +348,10 @@ module CommandT
326
348
  def jump_finder
327
349
  @jump_finder ||= CommandT::JumpFinder.new
328
350
  end
351
+
352
+ def tag_finder
353
+ @tag_finder ||= CommandT::TagFinder.new \
354
+ :include_filenames => get_bool('g:CommandTTagIncludeFilenames')
355
+ end
329
356
  end # class Controller
330
357
  end # module commandT
Binary file
@@ -28,5 +28,7 @@ def missing item
28
28
  exit 1
29
29
  end
30
30
 
31
+ RbConfig::MAKEFILE_CONFIG['CC'] = ENV['CC'] if ENV['CC']
32
+
31
33
  have_header('ruby.h') or missing('ruby.h')
32
34
  create_makefile('ext')
@@ -1,4 +1,4 @@
1
- # Copyright 2010-2011 Wincent Colaiuta. All rights reserved.
1
+ # Copyright 2010-2012 Wincent Colaiuta. All rights reserved.
2
2
  #
3
3
  # Redistribution and use in source and binary forms, with or without
4
4
  # modification, are permitted provided that the following conditions are met:
@@ -31,6 +31,8 @@ module CommandT
31
31
  # Specialized subclasses use different kinds of scanners adapted for
32
32
  # different kinds of search (files, buffers).
33
33
  class Finder
34
+ include VIM::PathUtilities
35
+
34
36
  def initialize path = Dir.pwd, options = {}
35
37
  raise RuntimeError, 'Subclass responsibility'
36
38
  end
@@ -41,8 +43,8 @@ module CommandT
41
43
  @matcher.sorted_matches_for str, options
42
44
  end
43
45
 
44
- def flush
45
- @scanner.flush
46
+ def open_selection command, selection, options = {}
47
+ ::VIM::command "silent #{command} #{selection}"
46
48
  end
47
49
 
48
50
  def path= path
@@ -1,4 +1,4 @@
1
- # Copyright 2010-2011 Wincent Colaiuta. All rights reserved.
1
+ # Copyright 2010-2012 Wincent Colaiuta. All rights reserved.
2
2
  #
3
3
  # Redistribution and use in source and binary forms, with or without
4
4
  # modification, are permitted provided that the following conditions are met:
@@ -31,5 +31,9 @@ module CommandT
31
31
  @scanner = FileScanner.new path, options
32
32
  @matcher = Matcher.new @scanner, options
33
33
  end
34
+
35
+ def flush
36
+ @scanner.flush
37
+ end
34
38
  end # class FileFinder
35
39
  end # CommandT
@@ -0,0 +1,44 @@
1
+ # Copyright 2011-2012 Wincent Colaiuta. All rights reserved.
2
+ #
3
+ # Redistribution and use in source and binary forms, with or without
4
+ # modification, are permitted provided that the following conditions are met:
5
+ #
6
+ # 1. Redistributions of source code must retain the above copyright notice,
7
+ # this list of conditions and the following disclaimer.
8
+ # 2. Redistributions in binary form must reproduce the above copyright notice,
9
+ # this list of conditions and the following disclaimer in the documentation
10
+ # and/or other materials provided with the distribution.
11
+ #
12
+ # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
13
+ # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
14
+ # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
15
+ # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
16
+ # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
17
+ # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
18
+ # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
19
+ # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
20
+ # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
21
+ # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
22
+ # POSSIBILITY OF SUCH DAMAGE.
23
+
24
+ require 'command-t/ext' # CommandT::Matcher
25
+ require 'command-t/scanner/tag_scanner'
26
+ require 'command-t/finder'
27
+
28
+ module CommandT
29
+ class TagFinder < Finder
30
+ def initialize options = {}
31
+ @scanner = TagScanner.new options
32
+ @matcher = Matcher.new @scanner, :always_show_dot_files => true
33
+ end
34
+
35
+ def open_selection command, selection, options = {}
36
+ if @scanner.include_filenames
37
+ selection = selection[0, selection.index(':')]
38
+ end
39
+
40
+ # open the tag and center the screen on it
41
+ ::VIM::command "silent! tag #{selection} | :normal zz"
42
+ end
43
+ end # class TagFinder
44
+ end # module CommandT
@@ -1,4 +1,4 @@
1
- # Copyright 2010-2011 Wincent Colaiuta. All rights reserved.
1
+ # Copyright 2010-2012 Wincent Colaiuta. All rights reserved.
2
2
  #
3
3
  # Redistribution and use in source and binary forms, with or without
4
4
  # modification, are permitted provided that the following conditions are met:
@@ -26,14 +26,17 @@ require 'command-t/settings'
26
26
 
27
27
  module CommandT
28
28
  class MatchWindow
29
- @@selection_marker = '> '
30
- @@marker_length = @@selection_marker.length
31
- @@unselected_marker = ' ' * @@marker_length
32
- @@buffer = nil
29
+ SELECTION_MARKER = '> '
30
+ MARKER_LENGTH = SELECTION_MARKER.length
31
+ UNSELECTED_MARKER = ' ' * MARKER_LENGTH
32
+ MH_START = '<commandt>'
33
+ MH_END = '</commandt>'
34
+ @@buffer = nil
33
35
 
34
36
  def initialize options = {}
35
37
  @prompt = options[:prompt]
36
38
  @reverse_list = options[:match_window_reverse]
39
+ @min_height = options[:min_height]
37
40
 
38
41
  # save existing window dimensions so we can restore them later
39
42
  @windows = []
@@ -80,6 +83,12 @@ module CommandT
80
83
  'setlocal textwidth=0' # don't hard-wrap (break long lines)
81
84
  ].each { |command| ::VIM::command command }
82
85
 
86
+ # don't show the color column
87
+ ::VIM::command 'setlocal colorcolumn=0' if VIM::exists?('+colorcolumn')
88
+
89
+ # don't show relative line numbers
90
+ ::VIM::command 'setlocal norelativenumber' if VIM::exists?('+relativenumber')
91
+
83
92
  # sanity check: make sure the buffer really was created
84
93
  raise "Can't find GoToFile buffer" unless $curbuf.name.match /GoToFile\z/
85
94
  @@buffer = $curbuf
@@ -87,9 +96,22 @@ module CommandT
87
96
 
88
97
  # syntax coloring
89
98
  if VIM::has_syntax?
90
- ::VIM::command "syntax match CommandTSelection \"^#{@@selection_marker}.\\+$\""
99
+ ::VIM::command "syntax match CommandTSelection \"^#{SELECTION_MARKER}.\\+$\""
91
100
  ::VIM::command 'syntax match CommandTNoEntries "^-- NO MATCHES --$"'
92
101
  ::VIM::command 'syntax match CommandTNoEntries "^-- NO SUCH FILE OR DIRECTORY --$"'
102
+ ::VIM::command 'setlocal synmaxcol=9999'
103
+
104
+ if VIM::has_conceal?
105
+ ::VIM::command 'setlocal conceallevel=2'
106
+ ::VIM::command 'setlocal concealcursor=nvic'
107
+ ::VIM::command 'syntax region CommandTCharMatched ' \
108
+ "matchgroup=CommandTCharMatched start=+#{MH_START}+ " \
109
+ "matchgroup=CommandTCharMatchedEnd end=+#{MH_END}+ concealends"
110
+ ::VIM::command 'highlight def CommandTCharMatched ' \
111
+ 'term=bold,underline cterm=bold,underline ' \
112
+ 'gui=bold,underline'
113
+ end
114
+
93
115
  ::VIM::command 'highlight link CommandTSelection Visual'
94
116
  ::VIM::command 'highlight link CommandTNoEntries Error'
95
117
  ::VIM::evaluate 'clearmatches()'
@@ -103,8 +125,8 @@ module CommandT
103
125
  # by some unexpected means of dismissing or leaving the Command-T window
104
126
  # (eg. <C-W q>, <C-W k> etc)
105
127
  ::VIM::command 'autocmd! * <buffer>'
106
- ::VIM::command 'autocmd BufLeave <buffer> ruby $command_t.leave'
107
- ::VIM::command 'autocmd BufUnload <buffer> ruby $command_t.unload'
128
+ ::VIM::command 'autocmd BufLeave <buffer> silent! ruby $command_t.leave'
129
+ ::VIM::command 'autocmd BufUnload <buffer> silent! ruby $command_t.unload'
108
130
 
109
131
  @has_focus = false
110
132
  @selection = nil
@@ -113,6 +135,16 @@ module CommandT
113
135
  end
114
136
 
115
137
  def close
138
+ # Unlisted buffers like those provided by Netrw, NERDTree and Vim's help
139
+ # don't actually appear in the buffer list; if they are the only such
140
+ # buffers present when Command-T is invoked (for example, when invoked
141
+ # immediately after starting Vim with a directory argument, like `vim .`)
142
+ # then performing the normal clean-up will yield an "E90: Cannot unload
143
+ # last buffer" error. We can work around that by doing a :quit first.
144
+ if ::VIM::Buffer.count == 0
145
+ ::VIM::command 'silent quit'
146
+ end
147
+
116
148
  # Workaround for upstream bug in Vim 7.3 on some platforms
117
149
  #
118
150
  # On some platforms, $curbuf.number always returns 0. One workaround is
@@ -123,10 +155,10 @@ module CommandT
123
155
  # For more details, see: https://wincent.com/issues/1617
124
156
  if $curbuf.number == 0
125
157
  # use bwipeout as bunload fails if passed the name of a hidden buffer
126
- ::VIM::command 'bwipeout! GoToFile'
158
+ ::VIM::command 'silent! bwipeout! GoToFile'
127
159
  @@buffer = nil
128
160
  else
129
- ::VIM::command "bunload! #{@@buffer.number}"
161
+ ::VIM::command "silent! bunload! #{@@buffer.number}"
130
162
  end
131
163
  end
132
164
 
@@ -244,7 +276,7 @@ module CommandT
244
276
  return unless VIM::Window.select(@window)
245
277
  unlock
246
278
  clear
247
- @window.height = 1
279
+ @window.height = @min_height > 0 ? @min_height : 1
248
280
  @@buffer[1] = "-- #{msg} --"
249
281
  lock
250
282
  end
@@ -273,17 +305,39 @@ module CommandT
273
305
  end
274
306
 
275
307
  def match_text_for_idx idx
276
- match = truncated_match @matches[idx]
308
+ match = truncated_match @matches[idx].to_s
277
309
  if idx == @selection
278
- prefix = @@selection_marker
310
+ prefix = SELECTION_MARKER
279
311
  suffix = padding_for_selected_match match
280
312
  else
281
- prefix = @@unselected_marker
313
+ if VIM::has_syntax? && VIM::has_conceal?
314
+ match = match_with_syntax_highlight match
315
+ end
316
+ prefix = UNSELECTED_MARKER
282
317
  suffix = ''
283
318
  end
284
319
  prefix + match + suffix
285
320
  end
286
321
 
322
+ # Highlight matching characters within the matched string.
323
+ #
324
+ # Note that this is only approximate; it will highlight the first matching
325
+ # instances within the string, which may not actually be the instances that
326
+ # were used by the matching/scoring algorithm to determine the best score
327
+ # for the match.
328
+ #
329
+ def match_with_syntax_highlight match
330
+ highlight_chars = @prompt.abbrev.downcase.chars.to_a
331
+ match.chars.inject([]) do |output, char|
332
+ if char.downcase == highlight_chars.first
333
+ highlight_chars.shift
334
+ output.concat [MH_START, char, MH_END]
335
+ else
336
+ output << char
337
+ end
338
+ end.join
339
+ end
340
+
287
341
  # Print just the specified match.
288
342
  def print_match idx
289
343
  return unless VIM::Window.select(@window)
@@ -305,7 +359,8 @@ module CommandT
305
359
  @window_width = @window.width # update cached value
306
360
  max_lines = VIM::Screen.lines - 5
307
361
  max_lines = 1 if max_lines < 0
308
- actual_lines = match_count > max_lines ? max_lines : match_count
362
+ actual_lines = match_count < @min_height ? @min_height : match_count
363
+ actual_lines = max_lines if actual_lines > max_lines
309
364
  @window.height = actual_lines
310
365
  (1..actual_lines).each do |line|
311
366
  idx = line - 1
@@ -323,10 +378,10 @@ module CommandT
323
378
  # highlighting extends all the way to the right edge of the window.
324
379
  def padding_for_selected_match str
325
380
  len = str.length
326
- if len >= @window_width - @@marker_length
381
+ if len >= @window_width - MARKER_LENGTH
327
382
  ''
328
383
  else
329
- ' ' * (@window_width - @@marker_length - len)
384
+ ' ' * (@window_width - MARKER_LENGTH - len)
330
385
  end
331
386
  end
332
387
 
@@ -334,7 +389,7 @@ module CommandT
334
389
  # window width.
335
390
  def truncated_match str
336
391
  len = str.length
337
- available_width = @window_width - @@marker_length
392
+ available_width = @window_width - MARKER_LENGTH
338
393
  return str if len <= available_width
339
394
  left = (available_width / 2) - 1
340
395
  right = (available_width / 2) - 2 + (available_width % 2)
@@ -37,6 +37,7 @@ module CommandT
37
37
  filenames = jumps_with_filename[1..-2].map do |line|
38
38
  relative_path_under_working_directory line.split[3]
39
39
  end
40
+
40
41
  filenames.sort.uniq
41
42
  end
42
43
 
@@ -0,0 +1,49 @@
1
+ # Copyright 2011-2012 Wincent Colaiuta. All rights reserved.
2
+ #
3
+ # Redistribution and use in source and binary forms, with or without
4
+ # modification, are permitted provided that the following conditions are met:
5
+ #
6
+ # 1. Redistributions of source code must retain the above copyright notice,
7
+ # this list of conditions and the following disclaimer.
8
+ # 2. Redistributions in binary form must reproduce the above copyright notice,
9
+ # this list of conditions and the following disclaimer in the documentation
10
+ # and/or other materials provided with the distribution.
11
+ #
12
+ # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
13
+ # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
14
+ # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
15
+ # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
16
+ # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
17
+ # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
18
+ # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
19
+ # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
20
+ # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
21
+ # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
22
+ # POSSIBILITY OF SUCH DAMAGE.
23
+
24
+ require 'command-t/vim'
25
+ require 'command-t/scanner'
26
+
27
+ module CommandT
28
+ class TagScanner < Scanner
29
+ attr_reader :include_filenames
30
+
31
+ def initialize options = {}
32
+ @include_filenames = options[:include_filenames] || false
33
+ end
34
+
35
+ def paths
36
+ taglist.map do |tag|
37
+ path = tag['name']
38
+ path << ":#{tag['filename']}" if @include_filenames
39
+ path
40
+ end.uniq.sort
41
+ end
42
+
43
+ private
44
+
45
+ def taglist
46
+ ::VIM::evaluate 'taglist(".")'
47
+ end
48
+ end # class TagScanner
49
+ end # module CommandT
@@ -27,7 +27,7 @@ module CommandT
27
27
  'Please see INSTALLATION and TROUBLE-SHOOTING in the help',
28
28
  'For more information type: :help command-t']
29
29
 
30
- [:flush, :show_buffer_finder, :show_file_finder].each do |method|
30
+ [:flush, :show_buffer_finder, :show_file_finder, :show_tag_finder].each do |method|
31
31
  define_method(method.to_sym) { warn *@@load_error }
32
32
  end
33
33
 
@@ -1,4 +1,4 @@
1
- # Copyright 2010-2011 Wincent Colaiuta. All rights reserved.
1
+ # Copyright 2010-2012 Wincent Colaiuta. All rights reserved.
2
2
  #
3
3
  # Redistribution and use in source and binary forms, with or without
4
4
  # modification, are permitted provided that the following conditions are met:
@@ -30,6 +30,14 @@ module CommandT
30
30
  ::VIM::evaluate('has("syntax")').to_i != 0
31
31
  end
32
32
 
33
+ def self.exists? str
34
+ ::VIM::evaluate(%{exists("#{str}")}).to_i != 0
35
+ end
36
+
37
+ def self.has_conceal?
38
+ ::VIM::evaluate('has("conceal")').to_i != 0
39
+ end
40
+
33
41
  def self.pwd
34
42
  ::VIM::evaluate 'getcwd()'
35
43
  end
metadata CHANGED
@@ -4,9 +4,8 @@ version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
6
  - 1
7
- - 3
8
- - 1
9
- version: 1.3.1
7
+ - 4
8
+ version: "1.4"
10
9
  platform: ruby
11
10
  authors:
12
11
  - Wincent Colaiuta
@@ -40,6 +39,7 @@ files:
40
39
  - ruby/command-t/finder/buffer_finder.rb
41
40
  - ruby/command-t/finder/file_finder.rb
42
41
  - ruby/command-t/finder/jump_finder.rb
42
+ - ruby/command-t/finder/tag_finder.rb
43
43
  - ruby/command-t/finder.rb
44
44
  - ruby/command-t/Makefile
45
45
  - ruby/command-t/match.c
@@ -52,6 +52,7 @@ files:
52
52
  - ruby/command-t/scanner/buffer_scanner.rb
53
53
  - ruby/command-t/scanner/file_scanner.rb
54
54
  - ruby/command-t/scanner/jump_scanner.rb
55
+ - ruby/command-t/scanner/tag_scanner.rb
55
56
  - ruby/command-t/scanner.rb
56
57
  - ruby/command-t/settings.rb
57
58
  - ruby/command-t/stub.rb
@@ -60,7 +61,6 @@ files:
60
61
  - ruby/command-t/vim/window.rb
61
62
  - ruby/command-t/vim.rb
62
63
  - doc/command-t.txt
63
- - doc/tags
64
64
  - plugin/command-t.vim
65
65
  has_rdoc: true
66
66
  homepage: https://wincent.com/products/command-t
data/doc/tags DELETED
@@ -1,46 +0,0 @@
1
- :CommandT command-t.txt /*:CommandT*
2
- :CommandTBuffer command-t.txt /*:CommandTBuffer*
3
- :CommandTFlush command-t.txt /*:CommandTFlush*
4
- :CommandTJumps command-t.txt /*:CommandTJumps*
5
- command-t command-t.txt /*command-t*
6
- command-t-authors command-t.txt /*command-t-authors*
7
- command-t-commands command-t.txt /*command-t-commands*
8
- command-t-contents command-t.txt /*command-t-contents*
9
- command-t-donations command-t.txt /*command-t-donations*
10
- command-t-history command-t.txt /*command-t-history*
11
- command-t-installation command-t.txt /*command-t-installation*
12
- command-t-intro command-t.txt /*command-t-intro*
13
- command-t-license command-t.txt /*command-t-license*
14
- command-t-mappings command-t.txt /*command-t-mappings*
15
- command-t-options command-t.txt /*command-t-options*
16
- command-t-pathogen command-t.txt /*command-t-pathogen*
17
- command-t-requirements command-t.txt /*command-t-requirements*
18
- command-t-trouble-shooting command-t.txt /*command-t-trouble-shooting*
19
- command-t-usage command-t.txt /*command-t-usage*
20
- command-t-website command-t.txt /*command-t-website*
21
- command-t-wildignore command-t.txt /*command-t-wildignore*
22
- command-t.txt command-t.txt /*command-t.txt*
23
- g:CommandTAcceptSelectionMap command-t.txt /*g:CommandTAcceptSelectionMap*
24
- g:CommandTAcceptSelectionSplitMap command-t.txt /*g:CommandTAcceptSelectionSplitMap*
25
- g:CommandTAcceptSelectionTabMap command-t.txt /*g:CommandTAcceptSelectionTabMap*
26
- g:CommandTAcceptSelectionVSplitMap command-t.txt /*g:CommandTAcceptSelectionVSplitMap*
27
- g:CommandTAlwaysShowDotFiles command-t.txt /*g:CommandTAlwaysShowDotFiles*
28
- g:CommandTBackspaceMap command-t.txt /*g:CommandTBackspaceMap*
29
- g:CommandTCancelMap command-t.txt /*g:CommandTCancelMap*
30
- g:CommandTClearMap command-t.txt /*g:CommandTClearMap*
31
- g:CommandTCursorEndMap command-t.txt /*g:CommandTCursorEndMap*
32
- g:CommandTCursorLeftMap command-t.txt /*g:CommandTCursorLeftMap*
33
- g:CommandTCursorRightMap command-t.txt /*g:CommandTCursorRightMap*
34
- g:CommandTCursorStartMap command-t.txt /*g:CommandTCursorStartMap*
35
- g:CommandTDeleteMap command-t.txt /*g:CommandTDeleteMap*
36
- g:CommandTMatchWindowAtTop command-t.txt /*g:CommandTMatchWindowAtTop*
37
- g:CommandTMatchWindowReverse command-t.txt /*g:CommandTMatchWindowReverse*
38
- g:CommandTMaxCachedDirectories command-t.txt /*g:CommandTMaxCachedDirectories*
39
- g:CommandTMaxDepth command-t.txt /*g:CommandTMaxDepth*
40
- g:CommandTMaxFiles command-t.txt /*g:CommandTMaxFiles*
41
- g:CommandTMaxHeight command-t.txt /*g:CommandTMaxHeight*
42
- g:CommandTNeverShowDotFiles command-t.txt /*g:CommandTNeverShowDotFiles*
43
- g:CommandTScanDotDirectories command-t.txt /*g:CommandTScanDotDirectories*
44
- g:CommandTSelectNextMap command-t.txt /*g:CommandTSelectNextMap*
45
- g:CommandTSelectPrevMap command-t.txt /*g:CommandTSelectPrevMap*
46
- g:CommandTToggleFocusMap command-t.txt /*g:CommandTToggleFocusMap*