[TxMt] CTags new command
Dave Baldwin
dave.baldwin at 3dlabs.com
Tue Sep 4 12:31:25 UTC 2012
Any users of CTags might find this useful. It uses the history file as a stack of places to return to. Create a new command in the CTags bundle.
Name Go Back
Scope Selector source
Key equivalent ^[
Save nothing
Input nothing
Output discard
#!/usr/bin/env ruby -wKU
require ENV['TM_SUPPORT_PATH'] + '/lib/textmate.rb'
history = ENV['TmCtagsHistoryFileName'] || 'tmtagsHistory'
lines = IO.readlines(history)
if lines.shift =~/=file:(.*?)&line=(\d+)/
File.open(history, 'w') {|f| f.puts lines}
TextMate.go_to :file => $1, :line => $2.to_i
end
Dave.
More information about the textmate
mailing list