chore: use InsertLeave
instead of TextChangedI
#88
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.
hey there!
thank you for this superb plugin, it's extremely useful!
i had a small issue with undoing changes done in insert mode and took
few minutes to fix it.
Not sure if it's the best way to fix it, and i haven't thoroughly tested
all features (there're a lot!).
gp.nvim
has autosave feature which is triggered by few events, one of which isTextChangedI
.when typing text in insert mode, any change done there saves the file. This grows the
:undolist
too much, because any change in insert mode is saved and treated as a separate change.Normally to undo the last change, you would press
u
once in normal mode. But with autosave triggered byTextChangedI
, you have to pressu
multiple times, for each change.using
InsertLeave
instead ofTextChangedI
avoids such problem.For comparison, consider scenario:
:GpChatNew
123
:undolist
on my setup it shows:
doing the equivalent when
InsertLeave
is used instead ofTextChangedI
:this is much better, because now you can undo the last change with single
u
press!