Skip to content

fix: hide editor cursor during command-line mode#10028

Open
nikhiltelkar2005-glitch wants to merge 1 commit into
VSCodeVim:masterfrom
nikhiltelkar2005-glitch:fix-hidden-command-line-cursor
Open

fix: hide editor cursor during command-line mode#10028
nikhiltelkar2005-glitch wants to merge 1 commit into
VSCodeVim:masterfrom
nikhiltelkar2005-glitch:fix-hidden-command-line-cursor

Conversation

@nikhiltelkar2005-glitch

Copy link
Copy Markdown

Description

Resolves #2436.

Currently, when a user enters command-line mode (:), search mode (/), or reverse search mode (?), the cursor remains visibly blinking in the active editor. Because Vim is terminal-based, the cursor is supposed to jump to the bottom status line and disappear from the main editor entirely to prevent confusion.

Since the VS Code extension API does not natively support completely hiding the cursor (TextEditorCursorStyle.Hidden does not exist), this PR approximates the native Vim behavior by mapping these modes to BlockOutline.

This effectively turns the cursor into a static, hollow box that represents a defocused/inactive state, which eliminates the distracting blinking cursor while typing in the status bar command-line.

Changes Made

  • src/mode/mode.ts: Introduced a new VSCodeVimCursorType.Hidden cursor type enum and mapped it to use vscode.TextEditorCursorStyle.BlockOutline.
  • src/mode/modeHandler.ts: Updated getCursorType() so that SearchInProgressMode and CommandlineInProgress now return the new Hidden cursor type instead of UnderlineThin.
  • test/index.ts: Updated the glob import and usage to conform to glob v10's Promise API to fix local test runner build errors.

Testing

  • Verified that compiling via yarn build-dev succeeds.
  • Verified that local tests run cleanly.
  • Manually tested entering :, /, and ? modes to ensure the active cursor stops blinking and transforms into the BlockOutline style until the mode is exited.

Resolves VSCodeVim#2436 by mapping command-line modes to a new Hidden cursor type (BlockOutline), preventing the cursor from blinking in the editor while typing in the status bar.
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.

0.11.2 doesn't start, rolling back to 0.11.1 fixes the issue

1 participant