File tree Expand file tree Collapse file tree 1 file changed +28
-1
lines changed Expand file tree Collapse file tree 1 file changed +28
-1
lines changed Original file line number Diff line number Diff line change 1
1
from typing import Optional
2
2
3
- from talon import actions
3
+ from talon import Module , actions
4
4
5
5
from ..targets .target_types import CursorlessTarget
6
6
7
+ mod = Module ()
8
+
9
+
10
+ @mod .action_class
11
+ class Actions :
12
+ def cursorless_get_text (
13
+ target : CursorlessTarget ,
14
+ hide_decorations : bool = False ,
15
+ ) -> str :
16
+ """Get target text. If hide_decorations is True, don't show decorations"""
17
+ return cursorless_get_text_action (
18
+ target ,
19
+ show_decorations = not hide_decorations ,
20
+ ensure_single_target = True ,
21
+ )[0 ]
22
+
23
+ def cursorless_get_text_list (
24
+ target : CursorlessTarget ,
25
+ hide_decorations : bool = False ,
26
+ ) -> list [str ]:
27
+ """Get texts for multiple targets. If hide_decorations is True, don't show decorations"""
28
+ return cursorless_get_text_action (
29
+ target ,
30
+ show_decorations = not hide_decorations ,
31
+ ensure_single_target = False ,
32
+ )
33
+
7
34
8
35
def cursorless_get_text_action (
9
36
target : CursorlessTarget ,
You can’t perform that action at this time.
0 commit comments