Sublime Forum

Tab size with proportional fonts

#1

Hello

There’s a minor bug that’s bugging me :stuck_out_tongue: 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.

0 Likes

#2

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!

0 Likes

#3

This is still an issue :frowning:

0 Likes

#4

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.

0 Likes

#5

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.

0 Likes

#6

I also would like to have this fixed.

0 Likes

#7

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!

0 Likes

#8

I have to agree, this is an annoying bug.

0 Likes