I am using Textmate for writing LaTex texts and I recently found that I can used a shortcut for completing environments (the help says "by default to cmd and < " but it turned out to be ctrl and <). Still, I get an error message that I did not find in the mailing list:
Failure running “Environment Based on Current Word”.
Users/andreasloeffler/Library/Application Support/TextMate/Managed/Bundles/LaTeX.tmbundle/Support/lib/Ruby/configuration.rb:29:in `load': Unexpected character { at line 1 (OSX::PropertyListError) from /Users/andreasloeffler/Library/Application Support/TextMate/Managed/Bundles/LaTeX.tmbundle/Support/lib/Ruby/configuration.rb:29:in `load_file' from /Users/andreasloeffler/Library/Application Support/TextMate/Managed/Bundles/LaTeX.tmbundle/Support/lib/Ruby/configuration.rb:28:in `open' from /Users/andreasloeffler/Library/Application Support/TextMate/Managed/Bundles/LaTeX.tmbundle/Support/lib/Ruby/configuration.rb:28:in `load_file' from /Users/andreasloeffler/Library/Application Support/TextMate/Managed/Bundles/LaTeX.tmbundle/Support/lib/Ruby/configuration.rb:38:in `load_user_file' from /Users/andreasloeffler/Library/Application Support/TextMate/Managed/Bundles/LaTeX.tmbundle/Support/lib/Ruby/configuration.rb:20:in `load' from Environment Based on Current Word:6
Unfortunately, I do not understand the source code so I do not know what to do. If I edit the command I see
#!/usr/bin/env ruby18 SUPPORT = ENV['TM_BUNDLE_SUPPORT'] require ENV['TM_SUPPORT_PATH'] + '/lib/ui' require ENV['TM_SUPPORT_PATH'] + '/lib/exit_codes' require SUPPORT + '/lib/Ruby/configuration.rb' @plist = Configuration.load shortcuts = @plist['environments'] lshortcuts = @plist['labeled_environments'] if ENV['TM_SCOPE'].match('beamer') then shortcuts.update(@plist['environments_beamer']) lshortcuts.update(@plist['labeled_environments_beamer']) end name = STDIN.read cmd = nil if name == "" then arr = ["custom…",nil] + (shortcuts.keys+lshortcuts.keys).sort ind = TextMate::UI.menu(arr) TextMate.exit_discard if ind.nil? if ind == 0 then name = "" else name = arr[ind] end end options = Array.new for key in shortcuts.keys do if shortcuts[key]['triggers'].index(name) then options << {:cmd => key, :setting => :no_label, :content => shortcuts[key]['content']} end end for key in lshortcuts.keys do if lshortcuts[key]['triggers'].index(name) then options << {:cmd => key, :setting => :label, :content => lshortcuts[key]['content']} end end opt = case options.length when 0 nil when 1 options[0] else ind = TextMate::UI.menu(options.map { |opt| opt[:cmd] }) ind.nil? ? nil : options[ind] end if !opt.nil? then print "\begin{#{opt[:cmd]}}" print "\n" if opt[:setting] == :no_label print opt[:content] || "\t$0" print "\n\end{#{opt[:cmd]}}" elsif name == "" print "\begin{${1:env}}\n\t$0\n\end{${1:env}}" else print "\begin{#{name}}\n\t$0\n\end{#{name}}" end
Can anybody point me to something I understand?
On 27 Feb 2021, at 14:26, andreas.loeffler--- via TextMate wrote:
I am using Textmate for writing LaTex texts and I recently found that I can used a shortcut for completing environments (the help says "by default to cmd and < " but it turned out to be ctrl and <). Still, I get an error message that I did not find in the mailing list:
Failure running “Environment Based on Current Word”.
Users/andreasloeffler/Library/Application Support/TextMate/Managed/Bundles/LaTeX.tmbundle/Support/lib/Ruby/configuration.rb:29:in `load': Unexpected character { at line 1 (OSX::PropertyListError)
It appears to be loading `~/Library/Preferences/com.macromates.textmate.latex_config.plist` and effectively reporting a parse error while doing so.
Try (re)move that file and see if that solves the problem.
Though make a copy, incase it contains customizations that you do not want to lose.