refactor: map ctrl-space to autocomplete by default in codemirror
This commit is contained in:
parent
28aeac4533
commit
26c8f35688
1 changed files with 9 additions and 6 deletions
|
|
@ -41,6 +41,9 @@ const DEFAULT_EDITOR_CONFIG: CodeMirror.EditorConfiguration = {
|
|||
foldGutter: true,
|
||||
autoCloseBrackets: true,
|
||||
gutters: ["CodeMirror-linenumbers", "CodeMirror-foldgutter"],
|
||||
extraKeys: {
|
||||
"Ctrl-Space": "autocomplete",
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -128,12 +131,12 @@ export function useCodemirror(
|
|||
}
|
||||
})
|
||||
|
||||
/* TODO: Show autocomplete on typing (this is just for testing) */
|
||||
cm.value.on("keyup", (instance, event) => {
|
||||
if (!instance.state.completionActive && event.key !== "Enter") {
|
||||
instance.showHint()
|
||||
}
|
||||
})
|
||||
// /* TODO: Show autocomplete on typing (this is just for testing) */
|
||||
// cm.value.on("keyup", (instance, event) => {
|
||||
// if (!instance.state.completionActive && event.key !== "Enter") {
|
||||
// instance.showHint()
|
||||
// }
|
||||
// })
|
||||
})
|
||||
|
||||
const setTheme = () => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue