Browse files

Don’t abort when user cancels “Documentation for Property”

Using abort will show an error dialog in TextMate 2.

Closes textmate/textmate#900.
  • Loading branch information...
1 parent 4a5fbcd commit 2a1f6f8724fe2da2be295c88e4a8cdb1ae4a1e99 @sorbits sorbits committed Mar 19, 2013
Showing with 3 additions and 1 deletion.
  1. +3 −1 Commands/Documentation for Property.plist
View
4 Commands/Documentation for Property.plist
@@ -137,6 +137,8 @@ $props = {
"z-index" => "visuren.html#propdef-z-index",
}
+require "#{ENV['TM_SUPPORT_PATH']}/lib/exit_codes.rb"
+
cur_line = ENV['TM_CURRENT_LINE']
cur_word = ENV['TM_CURRENT_WORD']
@@ -147,7 +149,7 @@ def request_prop_name
s = `\"#{ENV['TM_SUPPORT_PATH']}/bin/CocoaDialog.app/Contents/MacOS/CocoaDialog\" inputbox --float --title 'Documentation for Property' --informative-text 'What property would you like to lookup?' --text '#{$prop_name}' --button1 'Lookup' --button2 'Cancel' --button3 'Show All Properties'`
case (a = s.split("\n"))[0].to_i
when 1 then $props[a[1].to_s] || "propidx.html"
- when 2 then abort "<script>window.close()</script>"
+ when 2 then TextMate.exit_discard
when 3 then "propidx.html"
end
end

0 comments on commit 2a1f6f8

Please sign in to comment.