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

Add support for cursor direction #69

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

sashahilton00
Copy link
Contributor

This PR adds support for directional cursors.

It was thrown together pretty quickly, so feedback/checking for bugs is appreciated. It should be backwards compatible for the most part - the Cursor interface has been updated to take two new functions: ParseDirectionAndCursor & SerialiseDirectionAndCursor. Under the hood these just append a marker for the direction - Encode and Decode still exist and do most of the heavy lifting.

I have opted not to remove the original SetBeforeCursor/SetAfterCursor logic, as I'm not sure if there was a reason behind that initial decision that means it's still a vaild usecase. If not then this PR can be simplified, contributions welcome.

There is scope for end users to mess things up if they inadvertently mix non-directional cursors with directional cursors, though I've updated the docs, and it should be relatively self-explanatory how it works, so I'm not sure how much of an issue that really is.

Thoughts and feedback welcome, @pilagod & @Virviil pinging as you've both raised/discussed related issues in #66 & #67 respectively.

@sashahilton00 sashahilton00 marked this pull request as draft September 27, 2024 23:45
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.

2 participants