Closed A-R-C-A closed 8 years ago
I do plan on having some sort of support for converting to/from elastic tabstops eventually.
I see a few ways to do this:
1 and 2 are fairly easy and nearly identical. 3 would be quite a bit more difficult. Open to suggestions from anyone.
But as far as I can tell, your implementation doesn't treat indentation tabs differently; that is, the tab at the start of line is always aligned with the widest first tab within the same block of lines, regardless of whether that widest tab starts at the beginning of a line or somewhere within a line. This is something that has always bothered me, and I don't know if there's an official specification that mandates that behaviour, but it makes it impossible to use tabs for indentation in source code.
The way I think it should work is, it should ignore the start-of-line tabs and stretch only the ones that start within a line, and in addition to that, it should have a special case for TSV files that would work the way it does now, to be able to cope with empty cells in the first column.
With that in mind, I think the only option for the current implementation is to convert all tabs to spaces.
Thanks for the response. I hope I follow what you are saying.
your implementation doesn't treat indentation tabs differently
You are correct. Since within "indentation" tabs there is no text (i.e. empty cells), then it behaves as a "normal" tab.
but it makes it impossible to use tabs for indentation in source code.
I'm not sure what you mean. I've been using it for tab-indented source code just fine. There are cases where the first "cell" will get stretched if it needs to align with the cell above or below it.
But just because it has worked fine for what I'm doing certainly doesn't mean it's right for everyone, so I'm always open to suggestions.
I guess that was a bit hyperbolic. What I meant was, when you have an unindented line followed by an indented line and then you want to add trailing comments to both of them (using tabs, so that they align), the indented line will move right all the way to where the comment of the unindented line starts.
I'm assuming you mean trying to align something like this:
However it turns into:
I don't know if there's an official specification that mandates that behaviour
Guess I can't say "official" but this is working as it was originally intended.
I'll try to give it some thought see if there is a way to detect this kind of situation.
That's it. I suppose that should usually be an edge case in programming but I noticed it because I mostly deal with CSS.
The current implementation looks good, thanks.
This plugin would be even more useful when you include a convert option or a save/export feature to convert all the extended tabstops to a mixture of regular tabs (current tab settings) plus padding with spaces. So by using the same tab settings it would look everywhere the same. Now it's only usable with Npp.