helix-editor / helix

A post-modern modal text editor.
https://helix-editor.com
Mozilla Public License 2.0
33.33k stars 2.47k forks source link

indent-guides double character dilemma #6051

Open goyalyashpal opened 1 year ago

goyalyashpal commented 1 year ago

Steps

Assume: :set whitespace.render all or editor.whitespace.render = "all"

See that:

Screenrecord

https://user-images.githubusercontent.com/19423063/219942649-89e6ce5c-3cfb-42ca-bcb8-5477f0168c8f.mp4

External References

From VSCodium: It shows both the indentation guide, and whitespace character.

image

Versions

goyalyashpal commented 1 year ago

Solutions?

This is understandable in a TUI interface, but i thought to share here in hopes that maybe someone knows a solution - some way to draw two characters in same space

Unicode do has "combining" horizontal lines: (overline, double overline, low line) - but no combining vertical line i guess.

jakoschiko commented 1 year ago

Is there a reason why tabs need indent-guides? Setting the variable editor.whitespace.characters.tab to a visible character should have a similar effect.

I would prefer indent-guides to be only an alternative visualization of n spaces. Then I could use different characters for tabs and indent-guides.

goyalyashpal commented 1 year ago

Then I could use different characters for tabs and indent-guides.

that will solve for tab characters, but the space characters will still be shown one less times, right?

jakoschiko commented 1 year ago

that will solve for tab characters, but the space characters will still be shown one less times, right?

Yes, this would only reduce the ambiguity.

But I realized why indent-guides are also useful for tab indented documents: Because indent-guides are also drawn for empty lines.

goyalyashpal commented 1 year ago

But I realized why indent-guides are also useful for tab indented documents: Because indent-guides are also drawn for empty lines.

one hack for that can be to show indent guides only at ending space of a tab, rather than at start of the tab.

goyalyashpal commented 1 month ago

like these:

↦
⊢
⊦