✨ Added search and replace
This commit is contained in:
@@ -10,6 +10,7 @@ import {
|
||||
keymap,
|
||||
lineNumbers,
|
||||
rectangularSelection,
|
||||
KeyBinding,
|
||||
} from '@codemirror/view';
|
||||
import {
|
||||
bracketMatching,
|
||||
@@ -20,14 +21,17 @@ import {
|
||||
syntaxHighlighting,
|
||||
} from '@codemirror/language';
|
||||
import {defaultKeymap, history, historyKeymap,} from '@codemirror/commands';
|
||||
import {highlightSelectionMatches, searchKeymap} from '@codemirror/search';
|
||||
import {highlightSelectionMatches} from '@codemirror/search';
|
||||
import {autocompletion, closeBrackets, closeBracketsKeymap, completionKeymap} from '@codemirror/autocomplete';
|
||||
import {lintKeymap} from '@codemirror/lint';
|
||||
|
||||
import { vscodeSearch, customSearchKeymap, searchVisibilityField } from '../plugins/vscodeSearch';
|
||||
// 基本编辑器设置,包含常用扩展
|
||||
export const createBasicSetup = (): Extension[] => {
|
||||
return [
|
||||
|
||||
vscodeSearch,
|
||||
searchVisibilityField,
|
||||
|
||||
// 基础UI
|
||||
lineNumbers(),
|
||||
highlightActiveLineGutter(),
|
||||
@@ -59,9 +63,9 @@ export const createBasicSetup = (): Extension[] => {
|
||||
|
||||
// 键盘映射
|
||||
keymap.of([
|
||||
...customSearchKeymap as KeyBinding[],
|
||||
...closeBracketsKeymap,
|
||||
...defaultKeymap,
|
||||
...searchKeymap,
|
||||
...historyKeymap,
|
||||
...foldKeymap,
|
||||
...completionKeymap,
|
||||
|
||||
@@ -2,7 +2,7 @@ import {Compartment, Extension} from '@codemirror/state';
|
||||
import {EditorView, keymap} from '@codemirror/view';
|
||||
import {indentSelection} from '@codemirror/commands';
|
||||
import {indentUnit} from '@codemirror/language';
|
||||
import {TabType} from '../../../../bindings/voidraft/internal/models/models';
|
||||
import {TabType} from '@/../bindings/voidraft/internal/models/models';
|
||||
|
||||
// Tab设置相关的compartment
|
||||
export const tabSizeCompartment = new Compartment();
|
||||
|
||||
Reference in New Issue
Block a user