[code] [textadept] Working with clipboard

From: Qwerky <mr.qwerky.att.gmail.com>
Date: Sat, 14 Sep 2019 15:05:23 -0600

Hi Mitchell,

What is needed to make use of buffer.copy_text(), to write text to the
clipboard?  I've used `cliptext = ui.clipboard_text` to read the
clipboard text to a string, and then `for line in
cliptext:gmatch('.-\n') do` to read the lines of text from the string
into a table.

After that, `cliptext = table.concat(cliplines, '\n')` to join the table
lines, and `buffer.copy_text(cliptext)` to write that string back to the

Although this text looks the same on the clipboard, when it is pasted
into some other text, the result is not the same as pasting the original
clipboard text into some other text.  Specifically, when the original
text is rectangular, and is pasted into some other text, it pastes each
line into succeeding lines of the other text.  But after the above
operation, the text is pasted as a group of lines at a single place,
rather than individual lines going into succeeding lines of the
receiving text.

How can I keep the text rectangular after writing it back to the clipboard?


You are subscribed to code.att.foicica.com.
To change subscription settings, send an e-mail to code+help.att.foicica.com.
To unsubscribe, send an e-mail to code+unsubscribe.att.foicica.com.
Received on Sat 14 Sep 2019 - 17:05:23 EDT

This archive was generated by hypermail 2.2.0 : Sun 15 Sep 2019 - 06:37:22 EDT