File tree Expand file tree Collapse file tree 2 files changed +24
-19
lines changed Expand file tree Collapse file tree 2 files changed +24
-19
lines changed Original file line number Diff line number Diff line change 55
55
# "paste": "paste",
56
56
}
57
57
58
- wrappers = {
59
- "square" : ["[" , "]" ],
60
- "round" : ["(" , ")" ],
61
- "curly" : ["{" , "}" ],
62
- "angle" : ["<" , ">" ],
63
- "twin" : ["'" , "'" ],
64
- "quad" : ['"' , '"' ],
65
- "brick" : ["`" , "`" ],
66
- "escaped twin" : ["\\ '" , "\\ '" ],
67
- "escaped quad" : ['\\ "' , '\\ "' ]
68
- }
69
-
70
- mod .list ("cursorless_wrapper" , desc = "Supported wrappers for cursorless wrap action" )
71
- ctx .lists ["self.cursorless_wrapper" ] = wrappers .keys ()
72
-
73
- @mod .capture (rule = ("{user.cursorless_wrapper}" ))
74
- def cursorless_wrapper (m ) -> list [str ]:
75
- return wrappers [m .cursorless_wrapper ]
76
-
77
58
78
59
@mod .capture (rule = ("swap [<user.cursorless_target>] with <user.cursorless_target>" ))
79
60
def cursorless_swap (m ) -> str :
Original file line number Diff line number Diff line change
1
+ from talon import Module , Context
2
+
3
+ mod = Module ()
4
+ ctx = Context ()
5
+
6
+ wrappers = {
7
+ "square" : ["[" , "]" ],
8
+ "round" : ["(" , ")" ],
9
+ "curly" : ["{" , "}" ],
10
+ "angle" : ["<" , ">" ],
11
+ "twin" : ["'" , "'" ],
12
+ "quad" : ['"' , '"' ],
13
+ "brick" : ["`" , "`" ],
14
+ "escaped twin" : ["\\ '" , "\\ '" ],
15
+ "escaped quad" : ['\\ "' , '\\ "' ],
16
+ "space" : [" " , " " ]
17
+ }
18
+
19
+ mod .list ("cursorless_wrapper" , desc = "Supported wrappers for cursorless wrap action" )
20
+ ctx .lists ["self.cursorless_wrapper" ] = wrappers .keys ()
21
+
22
+ @mod .capture (rule = ("{user.cursorless_wrapper}" ))
23
+ def cursorless_wrapper (m ) -> list [str ]:
24
+ return wrappers [m .cursorless_wrapper ]
You can’t perform that action at this time.
0 commit comments