Offset treats tabs as multiple tokens when calculating the offset/col?
-
I was using my favorite editor to help troubleshoot an issue in a file parser. I could not figure out why when I hit CTRL-G to to so the offset in the log it was taking me to the wrong place. The file is tab delimited, so I then realized when I was moving the cursor using the right arrow that when went past a tab the column counter jumped 3! I expected tabs to be considered a single token in the file.
I realize there are probably other use cases where this behavior is useful, however when I go to a file offset I expect a tab to count as one “character”… Is there a way to alter this behavior?
-
Perhaps if you set the tab size to 1 for the file type in which you are using Ctrl-G to go to the offset? See Settings->Preferences->Tab Settings
You can always set it back to its “proper” value once you have fixed the issue(s).
-
Useful suggestion, which is what I did. However this is annoying because I have to remember to go back and change the tab setting back when I am done. I think it might be useful for this to be a configurable setting… Either by file type or even better as a more general setting that could be toggled on or off.