Merge pull request #12672 from overleaf/ae-emacs-compile-keydown

[cm6] Stop propagation of Ctrl-s when Emacs keybindings are enabled

GitOrigin-RevId: 32bebefb583ad813931af221cce7498d40fdbaf1
This commit is contained in:
Mathias Jakobsen
2023-04-20 11:02:46 +01:00
committed by Copybot
parent 462837b44d
commit 81a8fa2ce3

View File

@@ -8,6 +8,7 @@ import {
import { EmacsHandler } from '@replit/codemirror-emacs'
import { CodeMirror } from '@replit/codemirror-vim'
import { foldCode, toggleFold, unfoldCode } from '@codemirror/language'
import { EditorView } from '@codemirror/view'
import {
cursorToBeginningOfVisualLine,
cursorToEndOfVisualLine,
@@ -174,7 +175,16 @@ const options = [
load: () =>
import('@replit/codemirror-emacs').then(m => {
customiseEmacsOnce()
return m.emacs()
return [
m.emacs(),
EditorView.domEventHandlers({
keydown(event) {
if (event.ctrlKey && event.key === 's') {
event.stopPropagation()
}
},
}),
]
}),
},
]