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
Collaborator

👍 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
Copy link
Collaborator

@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!

luckydye pushed a commit to luckydye/zed that referenced this pull request May 2, 2024
For zed-industries#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

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
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.

None yet

2 participants