Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

revert ad45f0e, which breaks :CommandT with a path argument

Signed-off-by: Wincent Colaiuta <win@wincent.com>
  • Loading branch information...
commit fc5b5c39b4a929703b472a706c4c1bc3c04791ba 1 parent bcd3914
@garybernhardt garybernhardt authored committed
Showing with 11 additions and 15 deletions.
  1. +11 −1 ruby/command-t/controller.rb
  2. +0 −14 ruby/command-t/finder.rb
View
12 ruby/command-t/controller.rb
@@ -214,6 +214,13 @@ def get_list_or_string name
end
end
+ # Backslash-escape space, \, |, %, #, "
+ def sanitize_path_string str
+ # for details on escaping command-line mode arguments see: :h :
+ # (that is, help on ":") in the Vim documentation.
+ str.gsub(/[ \\|%#"]/, '\\\\\0')
+ end
+
def default_open_command
if !get_bool('&hidden') && get_bool('&modified')
'sp'
@@ -244,8 +251,11 @@ def ensure_appropriate_window_selection
def open_selection selection, options = {}
command = options[:command] || default_open_command
-
+ selection = File.expand_path selection, @path
+ selection = relative_path_under_working_directory selection
+ selection = sanitize_path_string selection
ensure_appropriate_window_selection
+
@active_finder.open_selection command, selection, options
end
View
14 ruby/command-t/finder.rb
@@ -22,7 +22,6 @@
# POSSIBILITY OF SUCH DAMAGE.
require 'command-t/ext' # CommandT::Matcher
-require 'command-t/vim/path_utilities'
module CommandT
# Encapsulates a Scanner instance (which builds up a list of available files
@@ -49,24 +48,11 @@ def flush
end
def open_selection command, selection, options = {}
- selection = File.expand_path selection, @path
- selection = relative_path_under_working_directory selection
- selection = sanitize_path_string selection
-
::VIM::command "silent #{command} #{selection}"
end
def path= path
@scanner.path = path
end
-
- private
-
- # Backslash-escape space, \, |, %, #, "
- def sanitize_path_string str
- # for details on escaping command-line mode arguments see: :h :
- # (that is, help on ":") in the Vim documentation.
- str.gsub(/[ \\|%#"]/, '\\\\\0')
- end
end # class Finder
end # CommandT
Please sign in to comment.
Something went wrong with that request. Please try again.