feat(term): implement copy_selection()

Implements the copy_selection() method, which returns the selected text.

Adds a copy_on_selection property. When this property is enabled, the
selected text will automatically be copied to the primary clipboard
(Linux X11/Wayland only).
This commit is contained in:
Leroy Hopson 2024-03-03 19:11:16 +13:00
parent 7f03761fb2
commit 13cf5ba023
No known key found for this signature in database
GPG key ID: D2747312A6DB51AA
3 changed files with 45 additions and 4 deletions

View file

@ -32,8 +32,7 @@ class TestInterface:
func test_has_property_blink_off_time():
assert_has_property_with_default_value("blink_off_time", 0.3)
# TODO: Implement copy_on_selection property.
func xtest_has_property_copy_on_selection():
func test_has_property_copy_on_selection():
assert_has_property_with_default_value("copy_on_selection", false)
# TODO: Implement update_mode property.
@ -53,8 +52,7 @@ class TestInterface:
func xtest_has_method_copy_all():
assert_has_method_with_return_type("copy_all", TYPE_STRING)
# TODO: Implement copy_selection() method.
func xtest_has_method_copy_selection():
func test_has_method_copy_selection():
assert_has_method_with_return_type("copy_selection", TYPE_STRING)
func test_has_method_get_cols():