Skip to content

Commit

Permalink
Disable hiding of selection inside focused widgets
Browse files Browse the repository at this point in the history
  • Loading branch information
marijnh committed May 2, 2024
1 parent bde3906 commit 5d4d490
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions src/draw-selection.ts
Expand Up @@ -111,12 +111,17 @@ const selectionLayer = layer({

const themeSpec: {[selector: string]: StyleSpec} = {
".cm-line": {
"& ::selection": {backgroundColor: "transparent !important"},
"&::selection": {backgroundColor: "transparent !important"}
"& ::selection, &::selection": {backgroundColor: "transparent !important"},
},
".cm-content": {
"& :focus": {
caretColor: "initial !important",
"&::selection, & ::selection": {
backgroundColor: "Highlight !important"
}
}
}
}
if (CanHidePrimary) {
themeSpec[".cm-line"].caretColor = "transparent !important"
themeSpec[".cm-content"] = {caretColor: "transparent !important"}
}
if (CanHidePrimary)
themeSpec[".cm-line"].caretColor = themeSpec[".cm-content"].caretColor = "transparent !important"
const hideNativeSelection = Prec.highest(EditorView.theme(themeSpec))

0 comments on commit 5d4d490

Please sign in to comment.