mirror of
https://github.com/rivo/tview.git
synced 2026-04-27 05:45:49 +03:00
[GH-ISSUE #307] textview selecting wrapped text copies with newline #232
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/tview#232
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @rsbondi on GitHub (Jun 14, 2019).
Original GitHub issue: https://github.com/rivo/tview/issues/307
If I have a long line that wraps to 2 lines, and I select with the mouse it pastes with the line up to the wrap, new line/carriage return, then the wrapped text
ex
it wraps like
which is as expected, but when I select and copy it copies as 2 lines, how can I preserve the single line when I copy?
I tried to find a way to capture the paste event(inputfield) and just strip the "\n"s, but I don't see Ctrl-shift-v in the key enumerations, can this be captured? Any other work around?
@rivo commented on GitHub (Jun 18, 2019):
To my knowledge, copy+paste functionality with selections (especially with the mouse) is a matter of how your terminal program handles it. On a Mac (using iTerm2), for example, this is done with Cmd-C which cannot be captured by a
tviewprogram. Unless I misunderstand your question (in which case, please let me know), this cannot be influenced by the application.You may be able to place text into the clipboard using some other library but I suppose it will be OS-dependent.