mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
39 lines
1.3 KiB
Plaintext
39 lines
1.3 KiB
Plaintext
<?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 -wKU
|
||
|
||
# If there’s a selection, output that twice (as a snippet)
|
||
# leaving the duplicate as the new selected text.
|
||
# Otherwise split the current line around the caret and
|
||
# output “right, left” to duplicate the line, leaving the
|
||
# caret in the same place on the new line
|
||
|
||
require File.join(ENV["TM_SUPPORT_PATH"], "lib/exit_codes.rb")
|
||
require File.join(ENV["TM_SUPPORT_PATH"], "lib/escape.rb")
|
||
|
||
if ENV['TM_SELECTED_TEXT'] != nil
|
||
TextMate.exit_insert_snippet(e_sn(ENV['TM_SELECTED_TEXT']) + "${0:" + e_snp(ENV['TM_SELECTED_TEXT']) + "}")
|
||
else
|
||
col = ENV['TM_LINE_INDEX'].to_i
|
||
TextMate.exit_insert_text(ENV['TM_CURRENT_LINE'][col..-1] + "\n" + ENV['TM_CURRENT_LINE'][0...col])
|
||
end</string>
|
||
<key>fallbackInput</key>
|
||
<string>none</string>
|
||
<key>input</key>
|
||
<string>selection</string>
|
||
<key>keyEquivalent</key>
|
||
<string>^D</string>
|
||
<key>name</key>
|
||
<string>Duplicate Line / Selection</string>
|
||
<key>output</key>
|
||
<string>afterSelectedText</string>
|
||
<key>uuid</key>
|
||
<string>C46A9DBC-0B06-49DF-838B-491B529ECF22</string>
|
||
</dict>
|
||
</plist>
|