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

Adjust the yss surrounds operator #11212

Merged
merged 6 commits into from
May 1, 2024

Conversation

weartist
Copy link
Contributor

@weartist weartist commented Apr 30, 2024

For #11084 In the case of an indentation in front of the current line, it may also be necessary to deal with the start point of the selected range

Release Notes:

  • N/A

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Apr 30, 2024
@weartist weartist changed the title adjust the yss surrounds operator Adjust the yss surrounds operator Apr 30, 2024
@weartist
Copy link
Contributor Author

Maybe we also need to deal with the case where the end of the line is a space, and if so, the logic at the end of the line needs to be modified somewhat

@ConradIrwin
Copy link
Member

👍 looks like that's what nvim does.

@weartist
Copy link
Contributor Author

It seems that there should be no difference between using movement::right directly and using offset+ch.len_utf8(), so I chose a more intuitive way

Use the new helpers for yss to do less buffer parsing.
@ConradIrwin ConradIrwin force-pushed the adjust_yss_for_vim branch from e2ae012 to 3533216 Compare May 1, 2024 03:42
@ConradIrwin
Copy link
Member

@weartist Instead of re-doing the buffer iteration, I thought it would be better to reuse the existing logic. Then I noticed that we didn't have a "go to last non-whitespace" yet...

So, pushed up some fixes to g _ so we can re-use that.

Along the way I noticed that counts weren't working, so I fixed that too.

@ConradIrwin ConradIrwin merged commit f39a242 into zed-industries:main May 1, 2024
8 checks passed
@weartist
Copy link
Contributor Author

weartist commented May 1, 2024

@weartist Instead of re-doing the buffer iteration, I thought it would be better to reuse the existing logic. Then I noticed that we didn't have a "go to last non-whitespace" yet...

So, pushed up some fixes to g _ so we can re-use that.

Along the way I noticed that counts weren't working, so I fixed that too.

@ConradIrwin It's more suitable, thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed The user has signed the Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants