Home Download Buy Blog Forum Support

elastic tabs

Re: elastic tabs

Postby adzenith on Fri Feb 22, 2013 6:33 pm

tobia wrote:This does not work at all with a proportional font!

PS: I had not realized this thread was old. But it's still not working!

Unfortunately there's no way to get it to work with a proportional font: the API doesn't allow either determining character width or inserting arbitrary-width spaces. The first could be worked around by opening the font myself and figuring out the character widths, but the second is a dealbreaker. Sorry!
adzenith
 
Posts: 1390
Joined: Mon Oct 19, 2009 9:12 pm

Re: elastic tabs

Postby Stefano.Rausch on Fri Feb 22, 2013 9:29 pm

Any chances that with the advent of ST3 elastic tabs could become reality?
Stefano.Rausch
 
Posts: 29
Joined: Thu Feb 14, 2013 5:05 pm

Re: elastic tabs

Postby adzenith on Sun Feb 24, 2013 1:02 pm

No, we still don't have API support. This plugin is as close as you can get (and it doesn't yet work in ST3 due to API changes).
adzenith
 
Posts: 1390
Joined: Mon Oct 19, 2009 9:12 pm

Re: elastic tabs

Postby qgates on Sun Feb 24, 2013 5:51 pm

While I'm not a fan of elastic tabs per se, I do feel there's room for improvement in Sublime's tab handling, the implementation for which should be fairly straightforward.

What I'm talking about here is simply definable tabstops. Just about every decent editor has this, and it's essential if an editor is to become a programmer or technician's "go to" for editing any kind of text files in the field. I have to drive another editor simply because Sublime is lacking in this basic area. And it's a showstopper for a whole bunch of colleagues.

So, my old favourite "Brief" had simply a command "tabs" that went something like this "tabs 5 25 40 45". That would define tabstops for the current buffer at those positions, and the remaining tabstops would be at a repeating interval of the last two (50,55,60,65 etc.). Some editors augment this by allowing tabstops to be left, centre and right aligned, though I see this as fairly pointless and only useful for formatting tables that are coded into tab delimited text files (in that case, you may just as well load stuff up in your favourite WP)

This is needed because text output files from numerous sources are tab delimited, and it's not possible to work with such files formatted even remotely correctly in Sublime. Traditional programmers prefer this approach since it gives flexibility as to how things are spaced out horizontally. Moreover, a number of older, less popular programming languages work with particular indentation positions. The above tabstop model would support use of tabs or spaces in much the same way that Sublime does presently; knowing tabstop positions allows Sublime to convert tabs to spaces and spaces to tabs in the same way it does at present.

Sublime is already set up with very flexible configuration for this with its default, user, filetype and project preferences.
qgates
 
Posts: 276
Joined: Mon Nov 05, 2012 4:33 pm

Re: elastic tabs

Postby mark4 on Wed Feb 27, 2013 6:30 am

this would drive me absolutely CRAZY if i had the feature turned on.
it would drive me absolutely crazy if you didnt :)
mark4
 
Posts: 108
Joined: Sat Feb 11, 2012 3:33 am

Re: elastic tabs

Postby adzenith on Wed Feb 27, 2013 4:26 pm

mark4 wrote:this would drive me absolutely CRAZY if i had the feature turned on.
it would drive me absolutely crazy if you didnt :)

Wait, what?
adzenith
 
Posts: 1390
Joined: Mon Oct 19, 2009 9:12 pm

Re: elastic tabs

Postby mark4 on Thu Feb 28, 2013 1:17 am

adzenith wrote:
mark4 wrote:this would drive me absolutely CRAZY if i had the feature turned on.
it would drive me absolutely crazy if you didnt :)

Wait, what?


Lol... One of the things im MAJORLY anal retentive about is source formatting. Cluster $*&# scatterbrain source formatting just drives me up the wall. I always indent by the same distance and always using spaces NEVER tabs. I always place my comments in the same column (i avoid interleaving comments with code etc). My source formatting is very VERY consistent across all my source files!

Having my indentations automaticlaly adjust themselves as i wrote code would be like eating garlik flavored ice cream... just WRONG!

but 99 times out of 100, when i look at someone elses sources which are cluster *$%! scatter brained i have to first reformat them just to be able to read them and retain what little sanity i have left. If you (they?) used this auto formatting even if the end result was not exactly to my liking it would be MUCH MUCH more consistent within the source file. So... i could not use this feature if it was ever implemented but if everyone else did it would be cool :)

thats what i meant :P~
mark4
 
Posts: 108
Joined: Sat Feb 11, 2012 3:33 am

Re: elastic tabs

Postby tobia on Fri May 10, 2013 9:28 pm

adzenith wrote:Unfortunately there's no way to get it to work with a proportional font: the API doesn't allow either determining character width or inserting arbitrary-width spaces.

Does it tell you what tab stop you're at? Meaning which visual tab stop a given tab character is aligned to? If it does, then you could have an option to insert consecutive tabs to fake the elastic tabstops, instead of spaces. So that the plugin would only have to change the number of consecutive tab characters to keep the columns aligned. It would sometimes waste a bit of space, as in this example, but it would not be too bad.
Attachments
Screen Shot 2013-05-10 at 22.50.57.png
Screen Shot 2013-05-10 at 22.50.57.png (21.5 KiB) Viewed 1517 times
tobia
 
Posts: 14
Joined: Tue Oct 16, 2012 2:55 pm

Re: elastic tabs

Postby adzenith on Sat May 11, 2013 7:28 pm

No, there's no way to find out what tabstop you're at. Scenarios like this are difficult:
iiiii ⇥ ⇥
mm ⇥

The tabs are being translated to single spaces by the forum software, unfortunately, but five i's need two tabs, and two m's need one tab, and there's no way to figure that out using the Sublime API -- you'd have to figure out what font is being used and do the math yourself.
adzenith
 
Posts: 1390
Joined: Mon Oct 19, 2009 9:12 pm

Re: elastic tabs

Postby adzenith on Wed Jun 19, 2013 9:15 pm

Support for ST3 has been added! Woo!
Thanks to lunixbochs for the edit abstraction.
adzenith
 
Posts: 1390
Joined: Mon Oct 19, 2009 9:12 pm

PreviousNext

Return to Ideas and Feature Requests

Who is online

Users browsing this forum: No registered users and 4 guests