Sublime Forum

Incorrect white space indicators in pasted code?

#1

Hello,

Not sure if this is a gug or I’m just not getting something right.

Normally, spaces are indicated by a dot and tab characters are indicated by a horizontal line in the editor. When I find a piece of code on the net and copy/paste it into the editor, all white space indicators showing up as dots, which indicate spaces. However, when I remove all spaces and add tabs instead, they are still showing up as dots and not horizontal line (which would indicated the presence of tabs).

However, when I delete these tabs, my cursor is moving correctly, eg jumping backwards 1 tab characters (or 4 spaces). Even if I save the file, close/reopen the editor, the white space indicators are still dots and not horizontal lines, even though the actual characters are tabs. Am I making any cents?

So just wondering if this is a bug or…?

This only happens when I paste code taken from the web. When I create a new file and start typing then it’s ok.

Windows 7 Ultimate x64
Sublime Text 2.0.1 x64 portable

0 Likes

#2

Sounds like they’re actually spaces—try selecting them. Sublime Text auto-converts tabs pasted into a spaces-indented document, which sounds like it describes what you’re seeing. Try setting the indentation in the lower-right to “tabs” and then pasting.

0 Likes

#3

Yes, that’s what it was! The little tab-to-spaces (and vice versa) converter in the lower right, that did the trick. I missed that one.

Thank you!

0 Likes