mirror of
https://github.com/lihop/godot-xterm.git
synced 2024-11-24 02:20:24 +01:00
fix(term): select() fixes
- Ensure selection is drawn. - Allow deselection by mouse click. - Respect copy_on_selection attribute.
This commit is contained in:
parent
b29d809bc0
commit
892ed45159
1 changed files with 12 additions and 0 deletions
|
@ -739,6 +739,18 @@ void Terminal::select(const int p_from_line, const int p_from_column, const int
|
||||||
tsm_screen_selection_reset(screen);
|
tsm_screen_selection_reset(screen);
|
||||||
tsm_screen_selection_start(screen, from_column, from_line);
|
tsm_screen_selection_start(screen, from_column, from_line);
|
||||||
tsm_screen_selection_target(screen, to_column, to_line);
|
tsm_screen_selection_target(screen, to_column, to_line);
|
||||||
|
|
||||||
|
String selection = copy_selection();
|
||||||
|
|
||||||
|
#if defined(__linux__)
|
||||||
|
if (copy_on_selection)
|
||||||
|
DisplayServer::get_singleton()->clipboard_set_primary(selection);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if (selection.length() > 0) {
|
||||||
|
selecting = true;
|
||||||
|
queue_redraw();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
String Terminal::copy_all() {
|
String Terminal::copy_all() {
|
||||||
|
|
Loading…
Reference in a new issue