Sublime Forum

Goto Anything :line:col syntax bug

#1

Hello, I found out, that :line:col is not working correctly when you have tabs on that line. It sees tab character as 1 col long, although it could be set to any width. So when you have code:

if ( x <= 0 )
{
<\t>return 1;
}

with tab size 4 and enter command :3:5 your cursor ends in line 3 column 8 instead of column 5.

Dracek

0 Likes

#2

I assume this is by design, because tools (e.g. gcc) report locations using character indices. A tab is only one character.
Example: make a file that contains a tab character and then a closing brace (’}’). Compile it using gcc. You’ll get the error “test.c:1:2: error: extraneous closing brace (’}’)”. Note that it’s column 2.

0 Likes