Vim block cursor doesn't cover the character under it (log times) #631

Closed
opened 2026-10-19 16:43:20 +00:00 by kayg · 3 comments
Owner

kayg (2026-10-19, production): in Vim mode the block cursor doesn't fully cover the character under it — on a daily log line '19:47 - 21:00', the block over the '1' in '21' is narrower than the glyph and offset (screenshot). The time span uses its own style (tabular figures / muted colour), so the cursor's width probably comes from a default character width instead of the actual glyph under the cursor.

kayg (2026-10-19, production): in Vim mode the block cursor doesn't fully cover the character under it — on a daily log line '19:47 - 21:00', the block over the '1' in '21' is narrower than the glyph and offset (screenshot). The time span uses its own style (tabular figures / muted colour), so the cursor's width probably comes from a default character width instead of the actual glyph under the cursor.
Author
Owner

Fixed on issue/vim-block-cursor (726bb17). Cause: @replit/codemirror-vim draws the block as its own box holding a copy of the letter, taking only the letter's left edge from the page; the copy ignored font-variant-numeric (tabular-nums on log times), so the box was narrower and offset. New packages/editor/src/vim/blockfit.ts wraps Vim's measure request: box = view.coordsForChar rect (width, top, height), letter and font settings copied from the span; end of line/tab/hidden syntax keep Vim's one-space block. e2e/vim-block.spec.ts: time digit, tag, link, bold, code, emoji, CJK, within 0.5px, light+dark, chromium-1440+webkit-1440: 4 passed. e2e/vim.spec.ts: all pass except one chromium run of the :noh search test (.cm-searchMatch count), which passed on webkit and does not touch this code.

Fixed on issue/vim-block-cursor (726bb17). Cause: @replit/codemirror-vim draws the block as its own box holding a copy of the letter, taking only the letter's left edge from the page; the copy ignored font-variant-numeric (tabular-nums on log times), so the box was narrower and offset. New packages/editor/src/vim/blockfit.ts wraps Vim's measure request: box = view.coordsForChar rect (width, top, height), letter and font settings copied from the span; end of line/tab/hidden syntax keep Vim's one-space block. e2e/vim-block.spec.ts: time digit, tag, link, bold, code, emoji, CJK, within 0.5px, light+dark, chromium-1440+webkit-1440: 4 passed. e2e/vim.spec.ts: all pass except one chromium run of the :noh search test (.cm-searchMatch count), which passed on webkit and does not touch this code.
Author
Owner

Landed in train AK, #635.

Train AK ran the full suite: fmt, clippy, workspace tests, the build, svelte-check, and every Playwright project in parallel shards.

Failures, each checked:

  • smart-note:19 (chromium-1440): 3 of 3 alone.
  • swipe-rows:516 (chromium-390): 24 of 24 alone (whole describe, repeat 3); load flake.

Contents:

  • #631: the Vim block cursor now covers exactly the character under it. Its width, top and height come from the editor's own measurement of that character (packages/editor/src/vim/blockfit.ts), so it fits proportional fonts, wide glyphs and line ends. New test e2e/vim-block.spec.ts.
Landed in train AK, #635. Train AK ran the full suite: fmt, clippy, workspace tests, the build, svelte-check, and every Playwright project in parallel shards. Failures, each checked: - `smart-note:19` (chromium-1440): 3 of 3 alone. - `swipe-rows:516` (chromium-390): 24 of 24 alone (whole describe, repeat 3); load flake. Contents: - #631: the Vim block cursor now covers exactly the character under it. Its width, top and height come from the editor's own measurement of that character (`packages/editor/src/vim/blockfit.ts`), so it fits proportional fonts, wide glyphs and line ends. New test `e2e/vim-block.spec.ts`.
Author
Owner

Closing during the 26 Oct handover cleanup: Landed in train AK (#635).

Closing during the 26 Oct handover cleanup: Landed in train AK (#635).
kayg closed this issue 2026-10-26 08:46:53 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
kayg/calternal#631
No description provided.