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

Align selection #1670

Closed
schoenenberg opened this issue Feb 16, 2022 · 10 comments
Closed

Align selection #1670

schoenenberg opened this issue Feb 16, 2022 · 10 comments

Comments

@schoenenberg
Copy link
Contributor

Hi,

I am currently writing a table in markdown and wanted to try out the & in selection mode (align_selection). So I did a multi-cursor select and tried to run the command, but nothing happend.

Also I didn't find some docs about it. Can you please explain to me how to use it? I am also willing to document this afterwards in the Helix docs.

Thank you very much!

Best regards,
Maximilian

@QiBaobin
Copy link
Contributor

Please refer to this

@archseer
Copy link
Member

I think & is a bit buggy and doesn't quite match kakoune behaviour. I've seen some user reports but I can't find it right now. Here's an example of it misaligning lines:

https://asciinema.org/a/QZlpWUeZGbTEr4PDsUfKaivIn

Doing the same thing in kakoune:

https://asciinema.org/a/klLjDWuPHnfYA96VHMxFZnzYE

I also don't quite understand the difference between 1&/2&/3&

@QiBaobin
Copy link
Contributor

It didn't consider different spaces/tabs, maybe other cases. Let me change the code and just mirror the kakoune logic anyway so that kakoune users would be familiar with it at the first place.

@schoenenberg
Copy link
Contributor Author

I think & is a bit buggy and doesn't quite match kakoune behaviour. I've seen some user reports but I can't find it right now. Here's an example of it misaligning lines:

https://asciinema.org/a/QZlpWUeZGbTEr4PDsUfKaivIn

Doing the same thing in kakoune:

https://asciinema.org/a/klLjDWuPHnfYA96VHMxFZnzYE

I also don't quite understand the difference between 1&/2&/3&

I don't understand how to use it.. What are the prerequisites to use it successfully?
asciicast

@archseer
Copy link
Member

You need to make a bunch of selections without also selecting the empty space.

#1101 (comment)

@archseer
Copy link
Member

For example, type a bunch of words on multiple lines, select all the lines.

s\w+<Enter> then &. & works by inserting enough spaces to make all the cursors align in each column

@schoenenberg
Copy link
Contributor Author

I think I understand now what it is doing.. But it feels kind of weird, because the existing spaces are not reused:
https://asciinema.org/a/iheaLvJJhB4H2ekLXcvq6MEjg

@schoenenberg
Copy link
Contributor Author

And for some reason it extends the selection to the next line after the &..
https://asciinema.org/a/Swi73Ao2yhODbUkympTDot3GJ

@archseer
Copy link
Member

archseer commented Mar 3, 2022

I think I understand now what it is doing.. But it feels kind of weird, because the existing spaces are not reused: https://asciinema.org/a/iheaLvJJhB4H2ekLXcvq6MEjg

Yes #1675 has addressed that

@kirawi
Copy link
Member

kirawi commented Jan 19, 2023

Closing due to the discussion above.

@kirawi kirawi closed this as completed Jan 19, 2023
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

No branches or pull requests

4 participants