Skip to content

Commit

Permalink
fix(vim-mode): disable special styling and active line hl when in table
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisgrieser committed Dec 22, 2024
1 parent 5bb4e53 commit 04812b0
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions source/5-editor/vim-mode.css
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@
outline: var(--vim-cursor-outline-width) solid var(--vim-cursor-outline);
}

.cm-editor:not(.cm-focused) .cm-fat-cursor.cm-fat-cursor.cm-fat-cursor {
/* complicated selector to FIX https://discord.com/channels/686053708261228577/989603365606531104/1320397699723300994 */
.cm-editor:not(.cm-focused)
.cm-sizer:not(:has(.cm-table-widget.has-focus))
+ .cm-vimCursorLayer
.cm-fat-cursor {
color: transparent;
background-color: transparent;
outline: 2px solid var(--hover-accent);
Expand Down Expand Up @@ -78,7 +82,9 @@
}
}

.vim-active-visual-line {
/* no active-line highlight when in table, since we already have active table
* cell highlight */
.vim-active-visual-line .cm-sizer:not(:has(.cm-table-widget.has-focus)) + .cm-vimCursorLayer {
& .cm-fat-cursor.cm-cursor-primary {
--cursorline-bg: hsl(var(--color-accent-hsl), 12.5%);
border-image: conic-gradient(var(--cursorline-bg) 0 0) fill 0 / 0 / 0 100vw;
Expand All @@ -90,10 +96,8 @@
}
}

& .cm-vimCursorLayer {
/* stylelint-disable-next-line declaration-no-important */
animation: none !important;
}
/* stylelint-disable-next-line declaration-no-important */
animation: none !important;
}

/* ───────────────────────────────────────────────── */
Expand Down

0 comments on commit 04812b0

Please sign in to comment.