You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is either a feature request or a support request, I'm not sure.
I believe I need some way to make actual changes to lines(), IE I have a new lines() and I want to replace the old one. I don't think this exists now.
For example, see this¹ fork of your vim example. In this code (branch ami-wv-cat, commit 1443d7f, line 1068) I have added support for the :!cat command from vim (read an entire file, paste it in at the cursor position). To do this I generate a new lines(), but I don't have a way to insert it into the Textarea once I've made it.
Things I've considered:
Use TextArea::new() and supply the new lines(). This doesn't work because of private members I can't access: Scroll is reset and also I lose the undo buffer.
cut() the old selection away, then put the data in the yank buffer and paste() it. I rejected this because it would stomp the contents of the yank buffer. Actually, I guess I could have copied out the yank buffer, saved it, performed the operation and then restored the yank buffer. But this has other problems: It's less convenient when you're replacing the entire file, like imagine you modified the entire file to uppercase; and it runs into issue Feature request: Should be possible to manipulate (collapse, censor) "Undo" stack items #90 (e.g. it will show up as two steps to the undo stack).
Is there an option I'm missing?
Should there maybe be a function like textarea.set_lines(lines, clear_styles)?
¹ This is a WIP and currently not "public", I would submit the nascent : support back to tui-textarea but I don't think it would make as good example code as what you have now.
The text was updated successfully, but these errors were encountered:
This is either a feature request or a support request, I'm not sure.
I believe I need some way to make actual changes to
lines()
, IE I have a new lines() and I want to replace the old one. I don't think this exists now.For example, see this¹ fork of your vim example. In this code (branch ami-wv-cat, commit 1443d7f, line 1068) I have added support for the
:!cat
command from vim (read an entire file, paste it in at the cursor position). To do this I generate a newlines()
, but I don't have a way to insert it into the Textarea once I've made it.Things I've considered:
cut()
the old selection away, then put the data in the yank buffer andpaste()
it. I rejected this because it would stomp the contents of the yank buffer. Actually, I guess I could have copied out the yank buffer, saved it, performed the operation and then restored the yank buffer. But this has other problems: It's less convenient when you're replacing the entire file, like imagine you modified the entire file to uppercase; and it runs into issue Feature request: Should be possible to manipulate (collapse, censor) "Undo" stack items #90 (e.g. it will show up as two steps to the undo stack).Is there an option I'm missing?
Should there maybe be a function like
textarea.set_lines(lines, clear_styles)
?¹ This is a WIP and currently not "public", I would submit the nascent
:
support back to tui-textarea but I don't think it would make as good example code as what you have now.The text was updated successfully, but these errors were encountered: