diff options
author | 2018-02-16 12:41:54 -0500 | |
---|---|---|
committer | 2018-02-16 12:41:54 -0500 | |
commit | 64dd43f93aeb50768ab9b82bf40a384f1a44ab16 (patch) | |
tree | 8db60757bd021d485bfc3cbc82c786290e4999f5 /core | |
parent | dbf70c7d7bf4dfda98a06d19a2827b611fa3db8b (diff) | |
download | textadept-64dd43f93aeb50768ab9b82bf40a384f1a44ab16.tar.gz textadept-64dd43f93aeb50768ab9b82bf40a384f1a44ab16.zip |
Fixed copy-paste between views in the terminal version.
Diffstat (limited to 'core')
-rw-r--r-- | core/ui.lua | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/core/ui.lua b/core/ui.lua index 7e4ca9ad..6b3f51b5 100644 --- a/core/ui.lua +++ b/core/ui.lua @@ -422,9 +422,15 @@ events_connect(events.BUFFER_DELETED, function() end end) --- Enables and disables mouse mode in curses and focuses and resizes views based --- on mouse events. +-- Properly handle clipboard text between views in curses, enables and disables +-- mouse mode, and focuses and resizes views based on mouse events. if CURSES then + local clipboard_text + events.connect(events.VIEW_BEFORE_SWITCH, + function() clipboard_text = ui.clipboard_text end) + events.connect(events.VIEW_AFTER_SWITCH, + function() ui.clipboard_text = clipboard_text end) + if not WIN32 then local function enable_mouse() io.stdout:write("\x1b[?1002h"):flush() end local function disable_mouse() io.stdout:write("\x1b[?1002l"):flush() end |