[TxMt] Quick question: Copy line above

Charilaos Skiadas cskiadas at uchicago.edu
Fri Apr 7 17:34:03 UTC 2006


Btw, you don't need a macro to implement this functionality. Just  
create a command with input the entire document, output "insert as  
text" and commands:

#!/usr/bin/env ruby
a = readlines
col = ENV['TM_LINE_NUMBER'].to_i-2
row = ENV['TM_LINE_INDEX'].to_i
print a[col][row..row]

I guess the question is what behavior you want when lines are  
wrapped. This will actually look at the previous code line, not the  
previous visual line. I haven't tested the macro, so I don't know  
what it would be doing.

Haris



More information about the textmate mailing list