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

Status bar: incorrect column number when line contains non-ASCII characters #21399

Closed
1 task done
fvsch opened this issue Dec 2, 2024 · 1 comment
Closed
1 task done
Labels
duplicate Additional reports of an existing issue

Comments

@fvsch
Copy link

fvsch commented Dec 2, 2024

Check for existing issues

  • Completed

Describe the bug / provide steps to reproduce it

  1. Create a new blank editor
  2. Paste the following text:
a'b
a"b
a’b
a“b
  1. Place the cursor at the end of line 1, and look at the line and column numbers displayed in the status bar.
  2. Repeat for each line.

Expected result:

1:4
2:4
3:4
4:4

Actual result:

1:4
2:4
3:6
4:6

It looks like Zed is looking at the number of UTF-8 bytes in the line before the cursor, instead of the number of UTF-8 characters.

Environment

Zed: v0.163.2 (Zed)
OS: macOS 15.1.1
Memory: 8 GiB
Architecture: aarch64

If applicable, add mockups / screenshots to help explain present your vision of the feature

No response

If applicable, attach your Zed.log file to this issue.

No response

@fvsch fvsch added admin read Pending admin review bug [core label] triage Maintainer needs to classify the issue labels Dec 2, 2024
@notpeter
Copy link
Member

notpeter commented Dec 2, 2024

It looks like Zed is looking at the number of UTF-8 bytes in the line before the cursor, instead of the number of UTF-8 characters.

You are correct. I believe this is a duplicate of:

@notpeter notpeter closed this as completed Dec 2, 2024
@notpeter notpeter added duplicate Additional reports of an existing issue and removed bug [core label] triage Maintainer needs to classify the issue admin read Pending admin review labels Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate Additional reports of an existing issue
Projects
None yet
Development

No branches or pull requests

2 participants