File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
src/processTargets/modifiers/scopeHandlers Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ export default class OneOfScopeHandler implements ScopeHandler {
43
43
throw new NotHierarchicalScopeError ( this . scopeType ) ;
44
44
}
45
45
46
- return keepOnlyTopLevelScopes (
46
+ return keepOnlyBottomLevelScopes (
47
47
this . scopeHandlers . flatMap ( ( scopeHandler ) =>
48
48
scopeHandler . getScopesTouchingPosition ( editor , position , ancestorIndex )
49
49
)
@@ -100,3 +100,14 @@ function keepOnlyTopLevelScopes(candidateScopes: TargetScope[]): TargetScope[] {
100
100
)
101
101
) ;
102
102
}
103
+
104
+ function keepOnlyBottomLevelScopes (
105
+ candidateScopes : TargetScope [ ]
106
+ ) : TargetScope [ ] {
107
+ return candidateScopes . filter (
108
+ ( { domain } ) =>
109
+ ! candidateScopes . some ( ( { domain : otherDomain } ) =>
110
+ domain . contains ( otherDomain )
111
+ )
112
+ ) ;
113
+ }
You can’t perform that action at this time.
0 commit comments