File tree Expand file tree Collapse file tree 3 files changed +29
-2
lines changed Expand file tree Collapse file tree 3 files changed +29
-2
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ def get_modifiers():
2222 "extendThroughStartOf" ,
2323 "extendThroughEndOf" ,
2424 "every" ,
25+ "ancestor" ,
2526 "first" ,
2627 "last" ,
2728 "previous" ,
@@ -101,6 +102,16 @@ def get_modifiers():
101102 },
102103 ],
103104 },
105+ {
106+ "id" : "ancestor" ,
107+ "type" : "modifier" ,
108+ "variations" : [
109+ {
110+ "spokenForm" : f"{ complex_modifiers ['ancestor' ]} <scope>" ,
111+ "description" : "Grandparent containing instance of <scope>" ,
112+ },
113+ ],
114+ },
104115 {
105116 "id" : "relativeScope" ,
106117 "type" : "modifier" ,
Original file line number Diff line number Diff line change 1515)
1616def cursorless_simple_scope_modifier (m ) -> dict [str , Any ]:
1717 """Containing scope, every scope, etc"""
18+ if hasattr (m , "cursorless_simple_scope_modifier" ):
19+ modifier = m .cursorless_simple_scope_modifier
20+
21+ if modifier == "every" :
22+ return {
23+ "type" : "everyScope" ,
24+ "scopeType" : m .cursorless_scope_type ,
25+ }
26+
27+ if modifier == "ancestor" :
28+ return {
29+ "type" : "containingScope" ,
30+ "scopeType" : m .cursorless_scope_type ,
31+ "ancestorIndex" : 1 ,
32+ }
33+
1834 return {
19- "type" : "everyScope" if m [ 0 ] == "every" else " containingScope" ,
35+ "type" : "containingScope" ,
2036 "scopeType" : m .cursorless_scope_type ,
2137 }
Original file line number Diff line number Diff line change 8181 "its" : " inferPreviousMark" ,
8282 "visible" : " visible"
8383 },
84- "simple_scope_modifier" : { "every" : " every" },
84+ "simple_scope_modifier" : { "every" : " every" , "grand" : " ancestor " },
8585 "interior_modifier" : {
8686 "inside" : " interiorOnly"
8787 },
You can’t perform that action at this time.
0 commit comments