refactor: map ctrl-space to autocomplete by default in codemirror
This commit is contained in:
committed by
liyasthomas
parent
4c55b9c304
commit
2bb3b71a70
@@ -41,6 +41,9 @@ const DEFAULT_EDITOR_CONFIG: CodeMirror.EditorConfiguration = {
|
|||||||
foldGutter: true,
|
foldGutter: true,
|
||||||
autoCloseBrackets: true,
|
autoCloseBrackets: true,
|
||||||
gutters: ["CodeMirror-linenumbers", "CodeMirror-foldgutter"],
|
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) */
|
// /* TODO: Show autocomplete on typing (this is just for testing) */
|
||||||
cm.value.on("keyup", (instance, event) => {
|
// cm.value.on("keyup", (instance, event) => {
|
||||||
if (!instance.state.completionActive && event.key !== "Enter") {
|
// if (!instance.state.completionActive && event.key !== "Enter") {
|
||||||
instance.showHint()
|
// instance.showHint()
|
||||||
}
|
// }
|
||||||
})
|
// })
|
||||||
})
|
})
|
||||||
|
|
||||||
const setTheme = () => {
|
const setTheme = () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user