Move required machinery into plugin/repeat.vim
.
#100
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.
repeat.vim
was written to be used as either an autoloaded script or a normally loaded script.In particular, as mappings used to be defined by the autoload script, they would only be actually injected if any other plugin has used the repeat functionality.
In practice, this creates problems as the mapping is not stable. One cannot define a custom mapping to
<Plug>(RepeatUndo)
, as the existence of the mapping from<Plug>(RepeatUndo)
is subject to the prior execution of any code that uses the repeat functionality.Similarly, when loading a session that was stored when
u
was remapped to<Plug>(RepeatUndo)
is almost guaranteed to be an issue. Asu
is already remapped, but the plugin has not constructed the next step, mapping<Plug>(RepeatUndo)
to the correct function.Just setting up the mappings seems like a solid solution to these problems. While it is a bit less efficient, if the user has enabled this plugin, they probably rely on it, and so the optimizations are most likely negligible.
Also updated the installation instructions. I would imagine most people use plugin managers today. And so it is no longer useful, in my mind, to be able to decide if the plugin will be eagerly or lazily loaded. It just complicates the installation process.
This should address #84 without a hack.
Someone can just create a mapping and exact it to always work.
My main concern is the breakage during session restore.