Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

small fix to insert color command to not print if nil

  • Loading branch information...
commit d078530610b4f8ebd0f0f8f24f67b4a606b1b51d 1 parent 236df30
@malkomalko authored
Showing with 4 additions and 5 deletions.
  1. +4 −5 Support/lib/autocomplete.rb
View
9 Support/lib/autocomplete.rb
@@ -38,15 +38,14 @@ def initialize(current_word)
else
lines_matching_regex = []
data.each_line { |line| lines_matching_regex << line if line =~ (/(#{current_word}\s+=)|(#{current_word}=)/) }
- if lines_matching_regex.size > 1
- TextMate::UI.alert(:warning, "Duplicate variable", "Please make sure you use unique variable names", 'Ok')
- elsif lines_matching_regex.size == 1
+
+ if lines_matching_regex.size == 1
current_word = lines_matching_regex.first.scan(/(#{classes_for_regex})/).to_s
custom = Dir["#{ENV['TM_DIRECTORY']}/**/*.j"].find {|a| a.include?(current_word+'.j') }.nil? ? false : true
@file_name = custom ? "#{ENV['TM_DIRECTORY']}/#{current_word}.j" : "#{ENV['TM_BUNDLE_SUPPORT']}/source/#{current_word}.j"
choices = create_choices(@file_name, 'instance')
- else
- # TextMate::UI.alert(:warning, "Debug", "(#{current_word}) nothing found", 'Ok')
+ elsif lines_matching_regex.size > 1
+ TextMate::UI.alert(:warning, "Duplicate variable", "Please make sure you use unique variable names", 'Ok')
end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.