[TxMt] Re: Elastic tabstops

Allan Odgaard throw-away-1 at macromates.com
Sat Jul 8 06:44:34 UTC 2006


On 7/7/2006, at 20:11, Chris Poirier wrote:

> [...] Anyway, the code is AFL, so feel free to make whatever  
> modifications you'd like.

Just FYI I added your command to the Source bundle (key equivalent  
⌥⌘] analogous with ⌥⌘[ for Indent Line / Selection.)

I also made the following (minor) change:

@@ -31,7 +31,7 @@
  selected_text = ENV.member?("TM_SELECTED_TEXT")
  relevant_line_pattern = /^[^=]+=/
-column_search_pattern = / *=/
+column_search_pattern = /[\t ]*=/
#
@@ -115,7 +115,7 @@
  block_top.upto(block_bottom) do |number|
    if lines[number-1] =~ relevant_line_pattern then
-      before, after = lines[number-1].split(/ *= */, 2)
+      before, after = lines[number-1].split(/[\t ]*=[\t ]*/, 2)
        lines[number-1] = before.ljust(best_column) + " = " + after
    end
  end




More information about the textmate mailing list