File tree Expand file tree Collapse file tree 1 file changed +15
-11
lines changed
Expand file tree Collapse file tree 1 file changed +15
-11
lines changed Original file line number Diff line number Diff line change 172172 brace . classList . remove ( 'brace-active' ) ;
173173 } ) ;
174174
175- if ( window . getSelection ( ) . toString ( ) . length < 2 ) {
176-
177- const cursor = cd . dropper . cursor ( ) ;
178-
179- if ( cursor && cursor . in ( 'brace' ) ) {
180- const currentBrace = cursor . getParent ( ) ;
181-
182- if ( currentBrace . id ) {
183- currentBrace . classList . add ( 'brace-active' ) ;
184- getPartnerBrace ( currentBrace ) . classList . add ( 'brace-active' ) ;
175+ if ( document . activeElement === cd ) {
176+
177+ if ( window . getSelection ( ) . toString ( ) . length < 2 ) {
178+
179+ const cursor = cd . dropper . cursor ( ) ;
180+
181+ if ( cursor && cursor . in ( 'brace' ) ) {
182+ const currentBrace = cursor . getParent ( ) ;
183+
184+ if ( currentBrace . id ) {
185+ currentBrace . classList . add ( 'brace-active' ) ;
186+ getPartnerBrace ( currentBrace ) . classList . add ( 'brace-active' ) ;
187+ }
185188 }
189+
186190 }
187-
191+
188192 }
189193
190194 } ) ;
You can’t perform that action at this time.
0 commit comments