File tree Expand file tree Collapse file tree 1 file changed +6
-10
lines changed Expand file tree Collapse file tree 1 file changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -22,17 +22,13 @@ export default class Highlight implements Action {
22
22
}
23
23
24
24
if ( targets . length === 0 ) {
25
- // Special case to clear highlights for the active editor when user says
25
+ // Special case to clear highlights for all editors when user says
26
26
// "highlight nothing"
27
- const { activeTextEditor } = ide ( ) ;
28
-
29
- if ( activeTextEditor == null ) {
30
- throw Error (
31
- "The `highlight nothing` command requires an active text editor" ,
32
- ) ;
33
- }
34
-
35
- await ide ( ) . setHighlightRanges ( highlightId , activeTextEditor , [ ] ) ;
27
+ await Promise . all (
28
+ ide ( ) . visibleTextEditors . map ( ( editor ) =>
29
+ ide ( ) . setHighlightRanges ( highlightId , editor , [ ] ) ,
30
+ ) ,
31
+ ) ;
36
32
} else {
37
33
await runOnTargetsForEachEditor ( targets , ( editor , targets ) =>
38
34
ide ( ) . setHighlightRanges (
You can’t perform that action at this time.
0 commit comments