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

Differentiate between "left" vs "right" tabstops #18

Open
eugenesvk opened this issue Nov 21, 2020 · 0 comments
Open

Differentiate between "left" vs "right" tabstops #18

eugenesvk opened this issue Nov 21, 2020 · 0 comments

Comments

@eugenesvk
Copy link

First of all, thanks a lot for creating this addon, I wish ST had a proper native support of elastic tabstops, but in the meantime your "lite" version is a great substitute!

However, there is one issue with elastic tabstops that appears when you use them both for "left-level" alignment (e.g. creating different levels from the beginning of a line) and for "right-level" alignment (e.g. for comments): if you have a comment on every line and if you want these comments vertically aligned with the help of your addon, it will break alignment of procedures at the start of the line like so (tabstops below are indicated with ):

→SomeVeryLongFunctionName(); →// 1 "left" tabstop and 1 "right" tabstop
→for (i                      →// same here, both vertical levels are aligned (left and right)
→{                           →// ISSUE: if you try to add a second tabstop to align the comments
→                            →if (...  // this line would BREAK: "if" is moved to the "right" alignment level with comments
→→if (... // instead of remaining at the second "left" level 
→→{

Currently the only way to resolve this is to mix tabs/spaces, e.g. use spaces for the "left" alignment and use tabstops for the "right" alignment and let your addon do it's magic ("left" alignment with spaces is usually easier since it's of constant width)

I was wondering if that's somehow possible to differentiate between the "left" and "right" tabstops at the level of your addon or is it too complicated?
Thanks!

P.S. The differentiation of "left" and "right" tabstops might still lead to imperfections, e.g. this alignment would need additional rules to work since the first line has 1 "right" tabstop, while the second line technically only 1 "left" tabstop, though it should be also treated like a "right" tabstop

function(→arg1
         →arg2)

However, even without any extra logic to handle this, it'd still be an improvement over the current inability to align comments if you have different levels from the beginning of the line

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant