Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate PGN at position using tree-sitter allowing follow-minor-mode to work #208

Merged
merged 2 commits into from Jun 6, 2023

Conversation

dekrueger
Copy link

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 at point-min.

  • pygn-mode-pgn-at-pos-02 and pygn-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.

Updated pygn-mode-pgn-at-pos and pygn-mode-pgn-at-pos-as-if-variation
to create PGN strings by walking tree-sitter nodes.

This change allows pygn-mode-follow-minor-mode to operate correctly
after free movement. See dwcoates#182
@rolandwalker
Copy link
Collaborator

rolandwalker commented Jun 5, 2023

Appreciated! Not obtuse! Would you like to comment out the failing tests in this PR? We can deal with them later.

@rolandwalker rolandwalker merged commit 9957f3e into dwcoates:master Jun 6, 2023
2 checks passed
@dekrueger dekrueger deleted the pgn-via-tree-sitter branch June 6, 2023 00:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants