File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -61,7 +61,9 @@ const stenoKeys: LayoutObject = {
6161 } ,
6262} ;
6363
64- function findKeyElements ( char : string ) : ElementsWithUtils {
64+ function findKeyElements ( char : string ) : ElementsWithUtils | null {
65+ if ( char === "\n" ) return null ;
66+
6567 if ( char === " " ) {
6668 return keymap . qsa ( ".keySpace" ) ;
6769 }
@@ -87,6 +89,8 @@ function highlightKey(currentKey: string): void {
8789 }
8890
8991 const $target = findKeyElements ( currentKey ) ;
92+ if ( $target === null || $target . length === 0 ) return ;
93+
9094 $target . addClass ( "activeKey" ) ;
9195 } catch ( e ) {
9296 if ( e instanceof Error ) {
@@ -100,7 +104,7 @@ async function flashKey(key: string, correct?: boolean): Promise<void> {
100104 if ( key === undefined ) return ;
101105 requestDebouncedAnimationFrame ( `keymap.flashKey.${ key } ` , async ( ) => {
102106 const elements = findKeyElements ( key ) ;
103- if ( elements . length === 0 ) return ;
107+ if ( elements === null || elements . length === 0 ) return ;
104108
105109 const themecolors = await ThemeColors . getAll ( ) ;
106110
You can’t perform that action at this time.
0 commit comments