Skip to content

Commit

Permalink
Preserve ^[ ]+\|[ ]* on Return
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewschaaf committed Jan 19, 2011
1 parent c3afd36 commit 3ab189e
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions Commands/Return.tmCommand
@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>beforeRunningCommand</key>
<string>nop</string>
<key>command</key>
<string>#!/usr/bin/env ruby
line = ENV['TM_CURRENT_LINE']
col = ENV['TM_LINE_INDEX'].to_i
m = /^([ ]+\|[ ]*)/.match line
if m and col &gt;= m[1].length
$stdout.write "\n#{m[1]}"
else
$stdout.write "\n"
end
</string>
<key>input</key>
<string>selection</string>
<key>keyEquivalent</key>
<string></string>
<key>name</key>
<string>Return</string>
<key>output</key>
<string>afterSelectedText</string>
<key>scope</key>
<string>source.jade</string>
<key>uuid</key>
<string>45F19BDD-2A4D-4848-83D5-E5F1A7FF4726</string>
</dict>
</plist>
Expand Down

0 comments on commit 3ab189e

Please sign in to comment.