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

Whitespace character for phantom line at end of file is that of "space", but doesn't really exist #2328

Closed
EpocSquadron opened this issue Apr 29, 2022 · 3 comments · Fixed by #2331
Labels
A-helix-term Area: Helix term improvements C-bug Category: This is a bug

Comments

@EpocSquadron
Copy link
Contributor

Summary

If you have a final newline at the end of the file, as is often standard to do, you will find that you can move your cursor past the newline character on to the next line. This is a bit of an illusion for convenience, as there is no actual character at that position, but makes it possible to use equivalently a or i to begin entering new characters on the line-after-end.

With visible whitespace on, moving the cursor to that phantom not-character shows the whitespace symbol for a space, even though it is not in fact a space. We should probably clean this up with a special-case whitespace character for "null" or some-such. Perhaps , the unicode character for null. We could also go with ~ as this is the character in the gutter to help distinguish this phantom line already.

Reproduction Steps

  1. Configure helix to show visible whitespace
  2. Open hx without any arguments
  3. Observe that the scratch buffer consists of exactly one newline character, located on the first line
  4. Move the cursor to the next line with j
  5. Observe that the whitespace character for this non-existent character is that for space

image

Helix log

N/A

Platform

Linux

Terminal Emulator

wezterm 20220427-144728-efcc4b48

Helix Version

helix 22.05-dev (477b88e)

@EpocSquadron EpocSquadron added the C-bug Category: This is a bug label Apr 29, 2022
@the-mikedavis
Copy link
Member

Oh whoops I thought I fixed this (45fd800) but I see it happening on latest too. I'll take a look

@the-mikedavis the-mikedavis added the A-helix-term Area: Helix term improvements label Apr 29, 2022
@EpocSquadron
Copy link
Contributor Author

Looks like the commit isn't on any branch according to GitHub, did it get rebased out by accident?

@the-mikedavis
Copy link
Member

Oh I see what went wrong 😅. PR in 5!

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