Skip to content

Fix relative line numbers showing in disabled mode#10052

Open
merdiofriviaisherebitch wants to merge 1 commit into
VSCodeVim:masterfrom
merdiofriviaisherebitch:fix-disabled-relative-lines
Open

Fix relative line numbers showing in disabled mode#10052
merdiofriviaisherebitch wants to merge 1 commit into
VSCodeVim:masterfrom
merdiofriviaisherebitch:fix-disabled-relative-lines

Conversation

@merdiofriviaisherebitch

@merdiofriviaisherebitch merdiofriviaisherebitch commented Jul 7, 2026

Copy link
Copy Markdown

Closes #10006.

Summary of Changes:

  • src/mode/modeHandler.ts: Set initialMode of newly created ModeHandlers to Mode.Disabled if configuration.disableExtension is true.
  • extensionBase.ts:
    • Moved compositionState definition to the top of activate so it can be referenced in earlier configuration change listeners.
    • Added configuration change listener check: when disableExtension setting changes, trigger toggleExtension to update all editors.
    • Updated toggleExtension: when disabling, loop through all active ModeHandlers in ModeHandlerMap and run mh.handleKeyEvent(SpecialKeys.ExtensionDisable) to transition them to Disabled mode (which reverts line numbers to absolute) before disposing them and clearing the map.
    • Awaited toggleExtension in the toggleVim command handler to prevent race conditions.
    • Updated the registerCommand wrapper to await callback(args) to ensure async commands can be fully awaited in tests.
  • test/configuration/configuration.test.ts: Added two unit tests to verify that new editors start with absolute line numbers when disableExtension is true, and that toggling the extension correctly toggles mode handler and updates line numbers style.
  • tsconfig.json & package.json: Added "skipLibCheck": true and pinned devDependency glob: "^7.2.3" to resolve type definition and version conflicts during test compilation.

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.

Smart Relative Line should be absolute when in DISABLED mode.

1 participant