Sublime Forum

Rowcol() incorrect column calculation with tabs

#1

It appears that view.rowcol() returns a column count not correctly accounting for tab size. If for example I have a line with 1 tab, tab size is set to 4, and I attempt to get the column at the end of the line, rowcol() will return a column location 3 less than expected. If I convert tabs to spaces then rowcol() returns the expected value. I am running ST2 on a 64bit PC.

0 Likes

#2

This is by design. Check out the code for converting tabs to spaces for some helper functions to translate back and forth.

0 Likes

#3

Thank you. I thought it might be by design. Perhaps the documentation should clarify that. Not a big deal. Just a bit more work for me.

0 Likes