|
|
@@ -14,6 +14,7 @@ import { useAppendExtensions, type AppendExtensions } from './utils/append-exten
|
|
|
import { useFocus, type Focus } from './utils/focus';
|
|
|
import { useGetDoc, type GetDoc } from './utils/get-doc';
|
|
|
import { useInitDoc, type InitDoc } from './utils/init-doc';
|
|
|
+import { useInsertPrefix, type InsertPrefix } from './utils/insert-prefix';
|
|
|
import { useInsertText, type InsertText } from './utils/insert-text';
|
|
|
import { useReplaceText, type ReplaceText } from './utils/replace-text';
|
|
|
import { useSetCaretLine, type SetCaretLine } from './utils/set-caret-line';
|
|
|
@@ -35,6 +36,7 @@ type UseCodeMirrorEditorUtils = {
|
|
|
setCaretLine: SetCaretLine,
|
|
|
insertText: InsertText,
|
|
|
replaceText: ReplaceText,
|
|
|
+ insertPrefix: InsertPrefix,
|
|
|
}
|
|
|
export type UseCodeMirrorEditor = {
|
|
|
state: EditorState | undefined;
|
|
|
@@ -83,6 +85,7 @@ export const useCodeMirrorEditor = (props?: UseCodeMirror): UseCodeMirrorEditor
|
|
|
const setCaretLine = useSetCaretLine(view);
|
|
|
const insertText = useInsertText(view);
|
|
|
const replaceText = useReplaceText(view);
|
|
|
+ const insertPrefix = useInsertPrefix(view);
|
|
|
|
|
|
return {
|
|
|
state,
|
|
|
@@ -94,5 +97,6 @@ export const useCodeMirrorEditor = (props?: UseCodeMirror): UseCodeMirrorEditor
|
|
|
setCaretLine,
|
|
|
insertText,
|
|
|
replaceText,
|
|
|
+ insertPrefix,
|
|
|
};
|
|
|
};
|