(e: WaveKeyboardEvent)
| 46 | const language = baseName && shellFileMap[baseName] ? shellFileMap[baseName] : undefined; |
| 47 | |
| 48 | function codeEditKeyDownHandler(e: WaveKeyboardEvent): boolean { |
| 49 | if (checkKeyPressed(e, "Cmd:e")) { |
| 50 | fireAndForget(() => model.setEditMode(false)); |
| 51 | return true; |
| 52 | } |
| 53 | if (checkKeyPressed(e, "Cmd:s") || checkKeyPressed(e, "Ctrl:s")) { |
| 54 | fireAndForget(model.handleFileSave.bind(model)); |
| 55 | return true; |
| 56 | } |
| 57 | if (checkKeyPressed(e, "Cmd:r")) { |
| 58 | fireAndForget(model.handleFileRevert.bind(model)); |
| 59 | return true; |
| 60 | } |
| 61 | return false; |
| 62 | } |
| 63 | |
| 64 | useEffect(() => { |
| 65 | model.codeEditKeyDownHandler = codeEditKeyDownHandler; |
nothing calls this directly
no test coverage detected