From 76bee5d75f71867bba0da263de05ed68996c054c Mon Sep 17 00:00:00 2001 From: Jonas Date: Thu, 5 Nov 2026 09:48:21 +0100 Subject: [PATCH 1/2] fix(gapcursor): visibility in dark mode and padding Make sure the gap cursor is visible in dark mode and fix its padding so the content doesn't jump when gap cursor is displayed. Signed-off-by: Jonas Assisted-by: ClaudeCode:claude-opus-5-5 --- src/css/prosemirror.scss | 8 +++++++- src/css/style.scss | 24 ++++-------------------- 2 files changed, 11 insertions(+), 21 deletions(-) diff --git a/src/css/prosemirror.scss b/src/css/prosemirror.scss index de7c259a662..ff97e821362 100644 --- a/src/css/prosemirror.scss +++ b/src/css/prosemirror.scss @@ -86,10 +86,16 @@ div.ProseMirror { } } - > *:first-child { + // Widgets such as the gap cursor don't take space, so make sure the top margin + // goes into the first real node. + > *:nth-child(1 of :not(:where(.ProseMirror-widget))) { margin-top: 10px; } + > .ProseMirror-gapcursor:first-child::after { + top: 8px; + } + > h1, h2, h3, diff --git a/src/css/style.scss b/src/css/style.scss index b58844f09ea..cc6b87d54f6 100644 --- a/src/css/style.scss +++ b/src/css/style.scss @@ -46,26 +46,10 @@ li.ProseMirror-selectednode { } } -.ProseMirror-gapcursor { - display: none; - pointer-events: none; - position: absolute; - - &:after { - content: ''; - display: block; - position: absolute; - top: -2px; - width: 20px; - border-top: 1px solid var(--color-main-text); - animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite; - } -} - -@keyframes ProseMirror-cursor-blink { - to { - visibility: hidden; - } +// Tiptap injects its own gap cursor stylesheet (black cursor) after ours, +// so the theme colour needs a more specific selector to win. +.ProseMirror .ProseMirror-gapcursor:after { + border-top-color: var(--color-main-text); } .animation-rotate { From 9bc16c09c9b8ba0dc08e48da17eb2ef74bfeb667 Mon Sep 17 00:00:00 2001 From: Jonas Date: Thu, 5 Nov 2026 10:29:25 +0100 Subject: [PATCH 2/2] fix(gapcursor): leave a gap beefore tables for the gap cursor Also leave a gap before tables for the gap cursor so it's possible to navigate the cursor between two tables with the mouse. Signed-off-by: Jonas Assisted-by: ClaudeCode:claude-opus-5-5 --- src/nodes/Table/TableView.vue | 3 ++ src/tests/extensions/Gapcursor.spec.ts | 43 ++++++++++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 src/tests/extensions/Gapcursor.spec.ts diff --git a/src/nodes/Table/TableView.vue b/src/nodes/Table/TableView.vue index 7e6b9d8a929..6355f348315 100644 --- a/src/nodes/Table/TableView.vue +++ b/src/nodes/Table/TableView.vue @@ -144,6 +144,9 @@ export default {