- Fix a typo in the warning message that appears when the .vimrc file fails to open
- Use loadConfiguration` from `extension.ts` instead of `configuration.load
- Use context.globalStorageUri.fsPath instead of context.globalStoragePath which is deprecated
The issue is pretty clearly that a recent VS Code update caused `onDidChangeTextDocument` events to be created (unreliably, from my testing) in such a way that trips our "change from disk" logic. We respond to that situation rather pessimistically by throwing out our undo stack, rather than trying to do something clever.
I haven't had the time lately to dig into the nitty gritty details of what changed on VS Code's side, so this is a bit of a shot in the dark.
The "change from disk" logic has caused issues in the past and I'm not sure how to reliably make it work, so I'm just deleting it for now. This may cause problems in some edge cases, but judging by my dogfooding, that'll be much less disruptive than losing your undo stack frequently enough that you can't trust it.
Fix for #7357 not only started setting # register but also added
additional call to file jump handling that broke the jump list. So,
still set # register if activeTextEditor is undefined, but skip the
extra task.
Fixes#7825.
- Handle vimrc path with $home variable correctly after saving vimrc file
- Fix vim.editVimrc command's error with vimrcPath's $HOME variable
- Display warning message when no vimrcPath is found
Fixes#7359, fixes#7358
Two things going on here:
- Notebook cells have the same file name, but different Documents/Uris
(fragment is different). We now use Uri (rather than file name) as the
ModeHandler key, so cells have separate VimStates and therefore undo
histories. VS Code lets you customize that behavior, but we don't
currently respect that setting.
- TextDocuments associated with notebook cells don't ever seem to have
`isDirty` set (not sure if this is a bug/limitation or the intended
design). This caused a "file changed on disk" handler to be triggered
on every change, which wipes that file's undo history. I've added
notebook cells as a special case disabling that, as a stopgap.
Fixes#6960
This removes a lot of code duplication, creates a better abstraction,
makes testing easier, and lays the groundwork for some features like:
- `:s` and similar commands working with `hlsearch` (#4934)
- The expression register (#4383)
- Better `incsearch` support (#4837)
The central change here is to take various pieces of global state which
were scattered and throughout the project and bring them together,
localizing them where possible to an object (`CommandLine`) held by
`VimState` (this naturally fixes#7038).
This applies to both ex commands and the search command line, which
means we finally have a uniform interface for them!
This fixes problems where rapid selection changes would cause multiple ModeHandlers to be created for the same TextEditor. Then only some selection changes would be reflected in VimState.
Fixes#6544
- Each register now points to an array - the i'th slot contains the content for the i'th cursor
- If there are more cursors than slots, the first slot is used as a backup
- Each slot contains either a RecordedState (in the case of a macro) or a string
- Newlines in those strings should be interpreted in the context of the associated RegisterMode
- The interface was changed somewhat to be safer and more consistent
I probably broke *something*, but the tests pass and this refactor enables further improvement of the terrible put logic, so I'll fix things as they come up.
As a side-effect, our linting just got substantially stricter, and this had to be a pretty wide-reaching change to comply. Sorry if this complicates any merges!
- Create a light wrapper around the undo stack which should protect us from index out of bounds errors
- Remove an optimization which made our undo stack ignore regular VSCode commands
- Stop adding an initial undo step before anything is done (not sure what the rationale there was)
Fixes#5209, fixes#4978
- If user inputs some text using the composition state, like when using
Korean input, that doesn't open a popup box, then pressing space should
be inserted straight away, but because the CompositionEnd wasn't being
awaited, the space would trigger as a normal 'type' command and would
join the previous ongoing CompositionEnd handling, preventing the space
from being handled.
- fixes#5865
Doing this in an event handler allows us to NOT await postponed view changes (see prior commit) while correctly clearing the status bar even in cases like hitting `scrolloff` or scrolling with mouse wheel.
Refs #5858
The motivation behind this is mostly to reduce the surface area Actions can interact with.
Remappings should not be visible to them (this is fundamentally logic internal to ModeHandler/Remapper).
* Remove "vim.remap" from the command palette
- This command is supposed to be used in keybindings, it can't be used
directly from the command palette
- fixes#5841
* Bugfixes on command "vim.remap"
- Add better error message to vim.remap
- Remove 'return' from 'after' handling so that the commands can still
run after finishing handling the 'after' keys.
Frankly, I'm a bit embarrassed that I wrote code to serialize and save the registers every time one changes. This can actually have a noticeable effect on performance if any registers have even modestly large values.
It seems `globalState` doesn't work in `deactivate`, so we need to store the register data in a file.
Fixes#5707