Skip to content

mac editor: the Vim status line sits at the bottom of the editor, not the window - #442

Merged
GoKubar merged 1 commit into
mainfrom
agent/mac-editor-ux/vim-status-line
Sep 14, 2026
Merged

GoKubar merged 1 commit into
mainfrom
agent/mac-editor-ux/vim-status-line

Conversation

@GoKubar

@GoKubar GoKubar commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Owner report:

in vim mode, commands / the current modes show up at the bottom of the app window rather than at the bottom of the editor window. So when there's the "problem" window below where you're editing, it feels unnatural.

What was wrong

VimModeStatusItem was an item of the global StatusBar, the last row of the detail column. The column is

HSplitView { EditorPane | PreviewPane }
[PanelResizeHandle + ProblemsPanel]   // if model.problemsVisible
Divider
StatusBar

so with the Problems panel open the mode indicator sat below the problems list — two panes away from the caret it describes. In vim the status line belongs to the window being edited.

The change

VimStatusLine is now the last row of EditorPane, directly under SourceEditorView and above CaptureBar/BridgeBar. It follows the editor when the Problems panel opens, and stays in the editor half when the preview is beside it rather than spanning the window. The :// command line shares that row. Chrome matches the bars around it: .font(.caption), .background(.bar), 8/3 padding.

With the preference off VimMode.Status.shared.indicator is nil and the body produces no view, so the editor gains no empty strip — asserted, not assumed.

status.vimMode and status.vimCommandLine are unchanged. The command-table description and the README now say where the line is.

The regression test

VimStatusLinePlacementTests pins the placement with real geometry in the whole ContentView, as FlashTeXMacApp builds it. SwiftUI's accessibility tree is not reachable from a hosted NSHostingView here (accessibilityChildren() comes back empty), so the tests measure NSView frames instead:

  • turning Vim on must take one caption row (6–40 pt) off the bottom of the source editor's scroll view, with its top edge unmoved;
  • the editor pane's own frame must not move — a row added to the window's status bar would shrink the pane instead. This is what separates "inside the editor pane, above the Problems panel" from "in the status bar";
  • typing : must not add a second row;
  • turning Vim off must give the row back exactly.

On b529e9d3 all four fail with

turning Vim on must take one caption row off the source editor
(lost 0.0 pt; editor (248.0, 525.0, 575.5, 187.0) -> (248.0, 525.0, 575.5, 187.0))

Also in here: a README row that was missing

duplicateLine (⌥⇧↓ / ⌥⇧↑, #419) landed without a row in the README shortcut table, so CommandTableTests.testCommandTableMatchesREADMEShortcuts and testEveryCommandHasAREADMERowAndEveryRowACommand have been failing on main since ec84cf3. This PR edits the same table, and would have shipped red without it, so the row is added here. Flagging it rather than burying it.

Gate

Fresh build directory, apps/mac, macOS 26.6 / Swift 6.3.3:

swift build && swift test --skip NearbyInterfaceTests --skip NearbyLANInterfaceTests
main b529e9d3 1136 executed, 2 failures (the two CommandTableTests above)
this branch 1140 executed, 0 failures

Test-name diff between the two runs is exactly the four new tests; nothing was lost or newly skipped.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu

… the window

Owner report: "in vim mode, commands / the current modes show up at the bottom
of the app window rather than at the bottom of the editor window. So when
there's the 'problem' window below where you're editing, it feels unnatural."

`VimModeStatusItem` was an item of the global `StatusBar`, so with the Problems
panel open the mode indicator sat below the problems list — two panes away from
the text it describes. In vim the status line belongs to the window being
edited. It is now `VimStatusLine`, the last row of `EditorPane`, directly under
`SourceEditorView` and above `CaptureBar`/`BridgeBar`: it follows the editor
when the Problems panel opens and stays in the editor half when the preview is
beside it. The `:`/`/` command line shares that row. Chrome matches the bars
around it (`.font(.caption)`, `.background(.bar)`, 8/3 padding).

With the preference off `VimMode.Status.shared.indicator` is nil and the body
produces no view, so the editor gains no empty strip.

`status.vimMode` and `status.vimCommandLine` are unchanged; the command table
and the README now say where the line is.

`VimStatusLinePlacementTests` pins the placement geometrically in the whole
`ContentView`: turning Vim on must take one caption row off the bottom of the
source editor while the editor pane's own frame stays put (a row added to the
window's status bar would shrink the pane instead), the `:` line must not add a
second row, and turning Vim off must give the row back exactly. All four fail on
b529e9d with "turning Vim on must take one caption row off the source editor
(lost 0.0 pt)".

Also documents ⌥⇧↓ / ⌥⇧↑ (duplicateLine, #419) in the README shortcut table:
that command landed without a README row, so `CommandTableTests` has been
failing on main since ec84cf3 and would have failed on this branch too.

Implementation-Agent: Claude Opus 5 (lane mac-editor-ux, linux-primary)
Commit-Executor: Claude Opus 5 (direct git, observed Cursor usage limit)
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
@GoKubar
GoKubar merged commit 2cf635b into main Sep 14, 2026
21 checks passed
d-q222 added a commit that referenced this pull request Sep 14, 2026
Merged origin/main (includes #413 Re-indent, #419 duplicate line, #442 Vim
status line, #445 caret fix). Conflict in apps/mac/README.md: kept both
the ⌘L Go to Line row (ours) and the ⌃I / Re-indent Document rows (theirs).
AccessibilityCommands.swift and CommandPalette.swift auto-merged with both
enum cases, entries, and palette actions.

Ran: cd apps/mac && swift test --filter 'GoToLineTests|CommandTableTests'
Executed 17 tests, with 0 failures (0 unexpected) in 0.125 (0.126) seconds.
grep -rn '<<<<<<<\|>>>>>>>' apps/mac: empty. README shortcuts unique.

Next: merge origin/main into editor-folding (#423).

Implementation-Agent: cursor-agent cursor-grok-4.6
Commit-Executor: cursor-agent
Lane-Owner: daniel-parent (mac-m5pro-dq222)
Co-authored-by: Cursor <[email protected]>
@GoKubar
GoKubar deleted the agent/mac-editor-ux/vim-status-line branch September 16, 2026 04:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant