SublimeText / ElasticTabstops

Tab characters automatically adjust to keep adjacent lines aligned.
https://github.com/SublimeText/ElasticTabstops
67 stars 6 forks source link

This is not a proper implementation of elastic tabstops #4

Open nick-gravgaard opened 11 years ago

nick-gravgaard commented 11 years ago

This is not a proper implementation of my invention. The whole point of elastic tabstops is that it works by moving tabstops rather than modifying the contents of the buffer (in this case by inserting spaces). The name "elastic tabstops" is a clue. There is a big difference between changing the view and changing the buffer.

As it stands the use of this package results in the contents of the buffer containing a mix of spaces and tabs for alignment which is problematic for all sorts of reasons.

I suggest that someone asks the author of Sublime Text to add the ability to set non-uniform tabstops on different lines to the API. Once that's done this package can be reworked to do it properly.

onetom commented 11 years ago

how can i +1 this? :)

hickford commented 11 years ago

Sign petition at http://sublimetext.userecho.com/topic/179072-/

FichteFoll commented 11 years ago

See also http://www.sublimetext.com/forum/viewtopic.php?f=4&t=147&p=6042#p6042 and http://sublimetext.userecho.com/topic/19265.

Fironet commented 7 years ago

Sign petition at http://sublimetext.userecho.com/topic/179072-/

This 404s. Any updates on support this feature natively, or at least the API functionality required?

adzenith commented 7 years ago

No, no updates unfortunately.

keith-hall commented 6 years ago

How would it look if phantoms were used with a monospace font to emulate elastic tab stops without modifying the buffer?

FichteFoll commented 6 years ago

Phantoms are kind of odd with their behavior, as can be observed with https://packagecontrol.io/packages/SublimeLinter%20Inline%20Errors. If you have a long phantom with whitespace, clicking on the phantom doesn't modify the selection where it would jump to the end of the line previously. I imagine you could hack something together with having a link for each whitespace character associated with its position and reconstruct the phantom on click to only extend to the clicked character? Not sure how well this would work out.

Other than that, to my knowledge phantoms always have at least some padding.

TL;DR: I wouldn't bother with phantoms since it'll still be suboptimal at best.