Repository navigation
Conversation
Adds an in-memory setter and override for `configuration.textwidth`. When `:set tw=N` is executed, the session override takes precedence. When no override is active, it continues to fall back to the active language's VS Code configuration. Fixes VSCodeVim#7809 Supersedes VSCodeVim#7811
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the
:set tw=N(:set textwidth=N) command.In PR #7747,
vim.textwidthwas made language-configurable by turningtextwidthinto a getter without a setter. As a result, running:set tw=Nthrew:TypeError: Cannot set property textwidth of #<Configuration> which has only a getter(which was caught and logged only to the Vim extension output channel).
Context & Comparison to PR #7811
@adamjhawley previously attempted to fix this in #7811 by calling
vscode.workspace.getConfiguration('vim').update('textwidth', ...)in the setter. However, as noted in the discussion there, writing tosettings.jsonon disk whenever someone runs:set tw=Nhas unwanted side effects: it dirties project repositories and triggers VS Code configuration reload events across extensions.This PR implements an in-memory override:
:set tw=Nis executed, the session override takes precedence in memory without writing to or dirtyingsettings.jsonon disk (preserving traditional Vim session semantics).[python],[markdown], etc.).Fixes #7809
Supersedes and closes #7811