Fix some small bugs in ledger-complete-at-point#472
Open
bcc32 wants to merge 5 commits into
Open
Conversation
Instead of unconditionally removing the string at point from the completions list, the correct approach is to skip the occurrence at point while scanning the buffer. If the same string appears in other transactions/postings not at point, it is a valid completion and should be offered as such (and, e.g., prevent TAB from needlessly changing the contents).
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.
Previously, completion in ledger-mode had the following unintuitive behaviors:
TAB sometimes changed the account or payee at point to a different one, even
if the one at point was a valid completion (such as declared in a directive
or appeared elsewhere in the buffer)
This is fixed by changing how the thing being completed is excluded from the
completion results (by position, instead of by filtering the final list of
strings).
TAB in the middle of a payee name or transaction comment would insert a
completion immediately before point without deleting the contents after
point.
This is fixed by correcting the END boundary returned by the capf, such that
it includes the suffix of the thing being completed.
The intermediate commits contain failing tests which are marked accordingly.
The subsequent commits fix those bugs and update the expected result.