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

feat: % support #8

Merged
merged 25 commits into from
May 21, 2024
Merged

feat: % support #8

merged 25 commits into from
May 21, 2024

Conversation

tris203
Copy link
Owner

@tris203 tris203 commented May 5, 2024

early days implementation

needs:

tests
docs
consideration about support when not directly over the bracket
only supports brackets at the moment
middlebracket support for if/else/end
comment support

will close #3
and part of #5

Copy link
Collaborator

@willothy willothy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me - do you think it's worth adding a test now or good to wait until more dev has been done on the feature?

@tris203
Copy link
Owner Author

tris203 commented May 5, 2024

This looks good to me - do you think it's worth adding a test now or good to wait until more dev has been done on the feature?

I am planning to add a test shortly, but i am just waiting until I finish a couple of minor type def/API changes which are in the other open PR

@baodrate
Copy link

baodrate commented May 6, 2024

still checking this out. looks good so far.

re: "only supports brackets at the moment", the % motion is mostly done by the matchit plugin included in [neo]vim (you've probably already looked at this, just mentioning for anyone else reading this PR). Unfortunately, all the logic is contained inside one big function, so we can't call into it directly, but useful as a reference.

@tris203
Copy link
Owner Author

tris203 commented May 6, 2024

still checking this out. looks good so far.

re: "only supports brackets at the moment", the % motion is mostly done by the matchit plugin included in [neo]vim (you've probably already looked at this, just mentioning for anyone else reading this PR). Unfortunately, all the logic is contained inside one big function, so we can't call into it directly, but useful as a reference.

Thanks. I'm not sure how much more of the implementation I want to recreate at this stage.

I have decided that I want to where possible avoid using the vim functions and use lua implementations of their behaviour.

As a % user what else do you think is MVP for the % matching @baod-rate

@tris203
Copy link
Owner Author

tris203 commented May 15, 2024

I think that I am happy with this level of implementation
% as a motion when not on a bracket is a bit weird, especially with nested brackets
Sometimes it takes you to the end, sometimes it does nothing

I will give it some time to mull over, but then i think this can get merged

@tris203 tris203 changed the title feat: begin % support feat: % support May 21, 2024
@tris203 tris203 merged commit fd62c75 into main May 21, 2024
9 checks passed
@tris203 tris203 deleted the percent_motion branch May 21, 2024 15:46
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.

Feature request: support % motion
3 participants