feat: multi cursor support - resolved #2215
This commit is contained in:
@@ -460,6 +460,17 @@ pre.ace_editor {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.cm-editor {
|
||||||
|
.cm-line::selection {
|
||||||
|
background-color: var(--accent-dark-color) !important;
|
||||||
|
color: var(--accent-contrast-color) !important;
|
||||||
|
}
|
||||||
|
.cm-line ::selection {
|
||||||
|
background-color: var(--accent-dark-color) !important;
|
||||||
|
color: var(--accent-contrast-color) !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.shortcut-key {
|
.shortcut-key {
|
||||||
@apply inline-flex;
|
@apply inline-flex;
|
||||||
@apply font-sans;
|
@apply font-sans;
|
||||||
|
|||||||
@@ -3,6 +3,8 @@ import {
|
|||||||
keymap,
|
keymap,
|
||||||
highlightSpecialChars,
|
highlightSpecialChars,
|
||||||
highlightActiveLine,
|
highlightActiveLine,
|
||||||
|
drawSelection,
|
||||||
|
dropCursor,
|
||||||
} from "@codemirror/view"
|
} from "@codemirror/view"
|
||||||
import {
|
import {
|
||||||
HighlightStyle,
|
HighlightStyle,
|
||||||
@@ -25,7 +27,10 @@ import {
|
|||||||
} from "@codemirror/search"
|
} from "@codemirror/search"
|
||||||
import { autocompletion, completionKeymap } from "@codemirror/autocomplete"
|
import { autocompletion, completionKeymap } from "@codemirror/autocomplete"
|
||||||
import { commentKeymap } from "@codemirror/comment"
|
import { commentKeymap } from "@codemirror/comment"
|
||||||
import { rectangularSelection } from "@codemirror/rectangular-selection"
|
import {
|
||||||
|
rectangularSelection,
|
||||||
|
// crosshairCursor,
|
||||||
|
} from "@codemirror/rectangular-selection"
|
||||||
import { lintKeymap } from "@codemirror/lint"
|
import { lintKeymap } from "@codemirror/lint"
|
||||||
|
|
||||||
export const baseTheme = EditorView.theme({
|
export const baseTheme = EditorView.theme({
|
||||||
@@ -46,8 +51,8 @@ export const baseTheme = EditorView.theme({
|
|||||||
".cm-widgetBuffer": {
|
".cm-widgetBuffer": {
|
||||||
position: "absolute",
|
position: "absolute",
|
||||||
},
|
},
|
||||||
".cm-selectionBackground, .cm-content ::selection, .cm-line ::selection": {
|
".cm-selectionBackground": {
|
||||||
backgroundColor: "var(--accent-color)",
|
backgroundColor: "var(--accent-dark-color)",
|
||||||
color: "var(--accent-contrast-color)",
|
color: "var(--accent-contrast-color)",
|
||||||
},
|
},
|
||||||
".cm-panels": {
|
".cm-panels": {
|
||||||
@@ -167,8 +172,8 @@ export const inputTheme = EditorView.theme({
|
|||||||
".cm-widgetBuffer": {
|
".cm-widgetBuffer": {
|
||||||
position: "absolute",
|
position: "absolute",
|
||||||
},
|
},
|
||||||
".cm-selectionBackground, .cm-content ::selection, .cm-line ::selection": {
|
".cm-selectionBackground": {
|
||||||
backgroundColor: "var(--accent-color)",
|
backgroundColor: "var(--accent-dark-color)",
|
||||||
color: "var(--accent-contrast-color)",
|
color: "var(--accent-contrast-color)",
|
||||||
},
|
},
|
||||||
".cm-panels": {
|
".cm-panels": {
|
||||||
@@ -355,6 +360,8 @@ export const basicSetup: Extension = [
|
|||||||
openText: "▾",
|
openText: "▾",
|
||||||
closedText: "▸",
|
closedText: "▸",
|
||||||
}),
|
}),
|
||||||
|
drawSelection(),
|
||||||
|
dropCursor(),
|
||||||
EditorState.allowMultipleSelections.of(true),
|
EditorState.allowMultipleSelections.of(true),
|
||||||
indentOnInput(),
|
indentOnInput(),
|
||||||
defaultHighlightStyle.fallback,
|
defaultHighlightStyle.fallback,
|
||||||
@@ -362,9 +369,9 @@ export const basicSetup: Extension = [
|
|||||||
closeBrackets(),
|
closeBrackets(),
|
||||||
autocompletion(),
|
autocompletion(),
|
||||||
rectangularSelection(),
|
rectangularSelection(),
|
||||||
|
// crosshairCursor(),
|
||||||
highlightActiveLine(),
|
highlightActiveLine(),
|
||||||
highlightSelectionMatches(),
|
highlightSelectionMatches(),
|
||||||
search(),
|
|
||||||
keymap.of([
|
keymap.of([
|
||||||
...closeBracketsKeymap,
|
...closeBracketsKeymap,
|
||||||
...defaultKeymap,
|
...defaultKeymap,
|
||||||
@@ -375,4 +382,5 @@ export const basicSetup: Extension = [
|
|||||||
...completionKeymap,
|
...completionKeymap,
|
||||||
...lintKeymap,
|
...lintKeymap,
|
||||||
]),
|
]),
|
||||||
|
search(),
|
||||||
]
|
]
|
||||||
|
|||||||
Reference in New Issue
Block a user