≡

wincent.dev

  • Products
  • Blog
  • Wiki
  • Issues
You are viewing an historical archive of past issues. Please report new issues to the appropriate project issue tracker on GitHub.
Home » Issues » Bug #1952

Bug #1952: ":CommandT <path>" breaks when "autochdir" is set and the current directory is not equal to <path>

Kind bug
Product Command-T
When 2012-02-23T15:08:55Z
Status open
Reporter RaymondKo
Tags no tags

Description

Hello and thank you for such a wonderful piece of software! Don't know how I lived before this!

I just updated to the latest git version and notice that CommandT is broken when I try to use it with the above conditions mentioned in the title. After some debugging, I seemed to have found the cause. It seems that class Finder in finder.rb is trying to use the internal instance variable @path, but it can never be actually set since the @path assignment operator is overloaded to set the one in @scanner.path instead. Trying to read from @path results in a 'nil'.

Since I don't know Ruby and whether you can overload @path to return @scanner.path, below is my simple one line fix. It is probably cleaner to somehow overload it or define a function to read from instead so one can't forget in the future, but that is up to your discretion.

diff --git a/ruby/command-t/finder.rb b/ruby/command-t/finder.rb
index 936cfde..2005f52 100644
--- a/ruby/command-t/finder.rb
+++ b/ruby/command-t/finder.rb
@@ -49,7 +49,7 @@ module CommandT
     end

     def open_selection command, selection, options = {}
-      selection = File.expand_path selection, @path
+      selection = File.expand_path selection, @scanner.path
       selection = relative_path_under_working_directory selection
       selection = sanitize_path_string selection

Comments

    Add a comment

    Comments are now closed for this issue.

    • contact
    • legal

    Menu

    • Blog
    • Wiki
    • Issues
    • Snippets