Home Download Buy Blog Forum Support

elastic tabs

Re: elastic tabs

Postby oxman on Thu Feb 10, 2011 9:33 pm

+1 :)
oxman
 
Posts: 66
Joined: Sun Aug 29, 2010 10:00 am

Re: elastic tabs

Postby adzenith on Tue Mar 01, 2011 6:40 am

Here it is:
https://github.com/SublimeText/ElasticTabstops

NOTES
  • You can't use the stock undo/redo/soft undo/soft redo commands, and instead need to use the wrappers that I've created for them (in the same file as the plugin). This is because undo and redo trigger on_modified, and on_modified is where this plugin does all of its processing. So every time you undo, the plugin will redo what you just undid, effectively taking away your ability to undo. My wrapper functions warn my plugin that an undo is coming so that it stands down.
  • Because you can't change the width of individual tabstops in Sublime Text, this plugin works by inserting spaces in front of tabs in order to align text. This has the benefit of making your files 100% compatible with editors that don't support elastic tabstops, but adds a couple of quirks to the behavior of the plugin that pretty much can't be worked around.
  • You'll need to be indenting with tabs.
Let me know of any questions or comments!

Edit: updated link.
Last edited by adzenith on Wed Dec 07, 2011 6:34 pm, edited 1 time in total.
adzenith
 
Posts: 1217
Joined: Mon Oct 19, 2009 9:12 pm

Re: elastic tabs

Postby oxman on Sat Apr 09, 2011 10:39 pm

Thanks but it don't work for me :(
Nothing happen.

And I want the same plugin work with space indentation.
And elastic tabstop in real time when I write.

Thanks for your work :)
oxman
 
Posts: 66
Joined: Sun Aug 29, 2010 10:00 am

Re: elastic tabs

Postby adzenith on Sun Apr 10, 2011 5:05 pm

The elasticity does in fact happen in real time.
I want the same plugin with space indentation too, but it's approximately impossible given Sublime Text's API right now—with spaces you have to guess intent, whereas with tabs you just have to count tabs, and Sublime Text's API doesn't tell you what changes have been made to a buffer (it just tells you that changes have been made), so it's hard to guess what's going on.

In terms of the plugin not working, can you give me more info? Are your files using tabs for indentation? Is the plugin loading correctly? etc.
You can run this for a little info:
Code: Select all
import sublime_plugin
sublime_plugin.all_callbacks.items()
adzenith
 
Posts: 1217
Joined: Mon Oct 19, 2009 9:12 pm

Re: elastic tabs

Postby oxman on Fri Aug 12, 2011 5:53 pm

If you like this feature, please vote up : http://sublimetext.userecho.com/topic/1 ... p-feature/
oxman
 
Posts: 66
Joined: Sun Aug 29, 2010 10:00 am

Re: elastic tabs

Postby oxman on Sun Aug 28, 2011 12:18 pm

up :)
oxman
 
Posts: 66
Joined: Sun Aug 29, 2010 10:00 am

Re: elastic tabs

Postby lencioni on Wed Dec 07, 2011 2:39 pm

If anybody is looking for the elastic tab stops code, it apparently has moved to https://github.com/SublimeText/ElasticTabstops
lencioni
 
Posts: 6
Joined: Thu Jul 08, 2010 3:32 pm

Re: elastic tabs

Postby GMath on Wed Dec 07, 2011 10:12 pm

Before SublimeText, I needed this feature. But now, I just use multi-select..
GMath
 
Posts: 13
Joined: Tue Dec 06, 2011 9:27 pm

Re: elastic tabs

Postby adzenith on Wed Dec 07, 2011 10:57 pm

I guess I don't really see how one substitutes for the other. I use multi-select and elastic tabstops together and it's fantastic. :)
adzenith
 
Posts: 1217
Joined: Mon Oct 19, 2009 9:12 pm

Re: elastic tabs

Postby tobia on Thu Feb 21, 2013 10:35 pm

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!
tobia
 
Posts: 10
Joined: Tue Oct 16, 2012 2:55 pm

PreviousNext

Return to Ideas and Feature Requests

Who is online

Users browsing this forum: Exabot [Bot], Yahoo [Bot] and 11 guests