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) does not take the rendered width of tabs into account #3274

Closed
emilyyyylime opened this issue Jul 31, 2022 · 0 comments · Fixed by #3276
Closed

& (align_selection) does not take the rendered width of tabs into account #3274

emilyyyylime opened this issue Jul 31, 2022 · 0 comments · Fixed by #3276
Labels
A-helix-term Area: Helix term improvements C-bug Category: This is a bug

Comments

@emilyyyylime
Copy link
Contributor

Summary

When using & to trigger align_selection, the editor only aligns based on the amount of characters, without taking into account that some characters may be wider than the others, like tab (0x09).

Reproduction Steps

I tried this:

  1. hx
  2. wrote
	abcde # this line contains a tab
        abcde # this line contains spaces

(i [tab] [enter/linefeed] [4 spaces (depending on your tab width)] [esc] [A-C] i abcde [esc])
3. typed &

I expected this to happen:
the 2 cursors should have appeared vertically aligned (they probably already were)

Instead, this happened:
the cursor on the line with a tab character has been padded out with n-1 spaces, where n is the width of a tab

Helix log

No response

Platform

Ubuntu on WSL2.0

Terminal Emulator

WSL2.0

Helix Version

helix 22.05 (e405e88)

@emilyyyylime emilyyyylime added the C-bug Category: This is a bug label Jul 31, 2022
@the-mikedavis the-mikedavis added the A-helix-term Area: Helix term improvements label Jul 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-helix-term Area: Helix term improvements C-bug Category: This is a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants