Home Download Buy Blog Forum Support

Tab size with proportional fonts

Tab size with proportional fonts

Postby tobia on Fri Dec 21, 2012 4:16 pm

Hello

There's a minor bug that's bugging me :P related to proportional fonts.

Since I switched to SublimeText I've been able to use proportional fonts for coding, something I've been wanting to do for a while, but could not do on my previous editor (Vim.) It all works very well. I've tried a number of different fonts and have settled on Verdana 13. It's a definite improvement over monospaced fonts.

The only thing that's somewhat off is the tab size. To get a tab size of approximately 4 spaces I have to set tab_size to 2. It would seem that SublimeText is reading the tab_size setting in em units. In fact, with my tab_size setting of 2 I get tabs just as wide as 2 em-dashes "—"

This does not pose a problem when I'm editing my own files, where I use tab characters for indentation, but it causes a graphical glitch when editing files that use spaces for indentation.

With the awesome detect_indentation feature I can open any kind of file and ST will automatically detect the correct tab_size for each file. But when it detects eg. 4 spaces and sets tab_size to 4, then it draws the dotted lines at 4em intervals… which is completely off from the actual indentation of 4 space characters.

I believe the correct behaviour would be to interpret tab_size as a multiple of the current font's space character width, instead of em units.
tobia
 
Posts: 10
Joined: Tue Oct 16, 2012 2:55 pm

Re: Tab size with proportional fonts

Postby mikecline on Thu Apr 25, 2013 6:55 am

I hope this gets fixed! This is so messed up. Please see screen shot.

Looks really bad in files which have mixed tabs and spaces for indentation!
Attachments
badTabIndentation.jpg
badTabIndentation.jpg (31.65 KiB) Viewed 1278 times
mikecline
 
Posts: 6
Joined: Sat Mar 24, 2012 5:07 am

Re: Tab size with proportional fonts

Postby happyface on Sun Aug 03, 2014 8:22 pm

This is still an issue :(
happyface
 
Posts: 5
Joined: Fri Jan 18, 2013 1:04 am

Re: Tab size with proportional fonts

Postby tolbert on Mon Aug 04, 2014 5:51 pm

happyface wrote:This is still an issue :(


No it's not, it's a natural consequence of using spaces for alignment with a proportional font.

A programmer using proportional font does exactly the wrong thing.
tolbert
 
Posts: 1
Joined: Mon Aug 04, 2014 5:50 pm

Re: Tab size with proportional fonts

Postby ckknight on Wed Aug 06, 2014 5:29 pm

If the tab size is 2 or 4, I'd expect it to be the exact width as 2 or 4 spaces, respectively.

Indentation at the beginning of a line should be indifferent to proportional or monospaced fonts.
ckknight
 
Posts: 1
Joined: Wed Aug 06, 2014 5:27 pm

Re: Tab size with proportional fonts

Postby Markus Gritsch on Tue Aug 12, 2014 1:12 pm

I also would like to have this fixed.
Markus Gritsch
 
Posts: 2
Joined: Tue Aug 12, 2014 1:10 pm

Re: Tab size with proportional fonts

Postby djr on Wed Aug 13, 2014 12:00 am

I have made some coding fonts with proportional and monospaced versions, and SublimeText's mishandling of proportional indents has been one of the most reported issues. So another vote from me on getting this fixed...thank you!
djr
 
Posts: 2
Joined: Tue Aug 12, 2014 11:31 pm


Return to Technical Support

Who is online

Users browsing this forum: Yahoo [Bot] and 20 guests