Generate PGN at position using tree-sitter allowing follow-minor-mode to work #208
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.
These changes are intended to produce an appropriate PGN string at any position in the buffer.
Also, they append a
*
to each PGN, which seems to work around issues that occur when a result code is absent from the tree-sitter parse.This appears to allow follow-minor-mode to function correctly.
But it does cause failure in the ert tests.
pygn-mode-pgn-at-pos-01
fails because the actual game header is now returned atpoint-min
.pygn-mode-pgn-at-pos-02
andpygn-mode-pgn-at-pos-05
fail because the PGN is no longer generated by truncating the buffer.My apologies in advance for any elisp obtuseness. It's not something I've worked with often.