Permalink
Browse files

Improve the tabify command to use TM_TAB_SIZE instead of guessing bas…

…ed on the first spaces encountered if the file appears to be mixed tabs and spaces

git-svn-id: http://svn.textmate.org/trunk/Bundles/Source.tmbundle@2835 dfb7d73b-c2ec-0310-8fea-fb051d288c6d
  • Loading branch information...
David Powers
David Powers committed Mar 8, 2006
1 parent 079b47a commit 92f683f7df532288f20c7691b48aac4d4876e7bb
Showing with 4 additions and 1 deletion.
  1. +4 −1 Commands/Tabify.plist
View
@@ -19,7 +19,10 @@ lines = Array.new()
line = $stdin.gets()
while(line != nil)
lines << line
- if(line =~ /^[ ]+\S/)
+ if(line =~ /^\t/) # mixed tabs with spaces, use TM's tab setting
+ spacing = ENV['TM_TAB_SIZE']
+ break
+ elsif(line =~ /^[ ]+\S/)
spacing = line[/^([ ]+)\S/, 1].length
break
end

0 comments on commit 92f683f

Please sign in to comment.