You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I like this plugin. Yes, it's not a proper implementation of elastic tabstops, because ST does not allow one yet, but it has the added benefit of being able to open the files in any fixed-width editor and see them properly aligned.
One things that bugs me though, is that I use ST with a proportional font and the alignment comes and goes. Example:
This obviously happens because some letters are wider than a space, so they overflow the tab stop and jump to the next one.
I'd like to develop a patch for this myself, but I'm unsure how to do it. Does ST have an API that returns the screen position (in pixels) of a certain character position (in rows and cols)? Do I have to compute the string widths myself, using some Python package that can parse the current font?
Even if I was able to determine the string widths, what's the best way to align them? If I add more spaces, I lose the automatic alignment in fixed-width editors.
Any idea?
The text was updated successfully, but these errors were encountered:
It's going to be pretty complicated, and you could easily lose automatic alignment in fixed-width editors.
I'd check out view.text_to_layout.
You could use different-width spaces, if your language supports them. I just tried using an em space in Python 3 and it appeared to work fine. Then in a fixed-width environment that em-width space would hopefully show up as a normal space. Could work?
I like this plugin. Yes, it's not a proper implementation of elastic tabstops, because ST does not allow one yet, but it has the added benefit of being able to open the files in any fixed-width editor and see them properly aligned.
One things that bugs me though, is that I use ST with a proportional font and the alignment comes and goes. Example:
This obviously happens because some letters are wider than a space, so they overflow the tab stop and jump to the next one.
I'd like to develop a patch for this myself, but I'm unsure how to do it. Does ST have an API that returns the screen position (in pixels) of a certain character position (in rows and cols)? Do I have to compute the string widths myself, using some Python package that can parse the current font?
Even if I was able to determine the string widths, what's the best way to align them? If I add more spaces, I lose the automatic alignment in fixed-width editors.
Any idea?
The text was updated successfully, but these errors were encountered: