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:
committed by
Copybot
parent
462837b44d
commit
81a8fa2ce3
@@ -8,6 +8,7 @@ import {
|
|||||||
import { EmacsHandler } from '@replit/codemirror-emacs'
|
import { EmacsHandler } from '@replit/codemirror-emacs'
|
||||||
import { CodeMirror } from '@replit/codemirror-vim'
|
import { CodeMirror } from '@replit/codemirror-vim'
|
||||||
import { foldCode, toggleFold, unfoldCode } from '@codemirror/language'
|
import { foldCode, toggleFold, unfoldCode } from '@codemirror/language'
|
||||||
|
import { EditorView } from '@codemirror/view'
|
||||||
import {
|
import {
|
||||||
cursorToBeginningOfVisualLine,
|
cursorToBeginningOfVisualLine,
|
||||||
cursorToEndOfVisualLine,
|
cursorToEndOfVisualLine,
|
||||||
@@ -174,7 +175,16 @@ const options = [
|
|||||||
load: () =>
|
load: () =>
|
||||||
import('@replit/codemirror-emacs').then(m => {
|
import('@replit/codemirror-emacs').then(m => {
|
||||||
customiseEmacsOnce()
|
customiseEmacsOnce()
|
||||||
return m.emacs()
|
return [
|
||||||
|
m.emacs(),
|
||||||
|
EditorView.domEventHandlers({
|
||||||
|
keydown(event) {
|
||||||
|
if (event.ctrlKey && event.key === 's') {
|
||||||
|
event.stopPropagation()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
]
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|||||||
Reference in New Issue
Block a user