This commit is contained in:
duanfuxiang
2025-01-05 11:51:39 +08:00
commit 0c7ee142cb
215 changed files with 20611 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
import { Prec } from "@codemirror/state";
import { keymap } from "@codemirror/view";
function CompletionKeyWatcher(
handleAcceptKey: () => boolean,
handlePartialAcceptKey: () => boolean,
handleCancelKey: () => boolean
) {
return Prec.highest(
keymap.of([
{
key: "Tab",
run: handleAcceptKey,
},
{
key: "ArrowRight",
run: handlePartialAcceptKey,
},
{
key: "Escape",
run: handleCancelKey,
},
])
);
}
export default CompletionKeyWatcher;