Strange behaviour with find all in current document results
-
This is a ‘find all in current document’ search for an asterisk. Can anyone tell me why the search result for line 9 displays only a single space after the asterisk instead a full tab space like all the other lines? As can be seen in the screenshot, that line in the document has a tab space.
I’ve done some investigating and the only time it happens is when:
- The line starts with an asterisk. If the asterisk is removed, the tab space will be displayed.
- The line is located anywhere above the last line that starts with the word A (even if those lines don’t start with A). If it’s moved to any line below line 10, the tab space will be displayed.

-
It has to do with tab stop positions, probably every 4 spaces for the results window.
If you add an extra line at the top of your file, and re-do the search, then the (new) line 10 will appear like the original lines 12, 14, 22.
In case that isn’t clear enough, note that 9 is single digit and 12/14/22 are each two digits. -
Can anyone tell me why the search result for line 9 displays only a single space after the asterisk instead a full tab space like all the other lines?
I’m certain there is a tab after the asterisk in line 9 in the search results window. You can verify that by highlighting the asterisk through and including the following “A”, copying, then pasting that into your document (or a new tab).
The visual results are a combination of the way tabs work in Notepad++ — so-called “typewriter tabs” — and using a proportional font.
Tab stops are at fixed positions, spaced by the distance equal to a the width of chosen number of spaces in the font you’re using. (In document tabs, that number is chosen in Settings | Preferences… | Indentation | Indent size. However, regardless of that setting, in the search results window the number is always 4.) A tab character renders as a space of whatever width is needed to put the next character at the next tab stop.
Notice that the colons after single digit and double digit line numbers don’t quite line up. That is because you are using a proportional font. Notepad++ adds a space to make up for the missing digit, and with a fixed width font, that would line them up. You are using a proportionally spaced font, and a space is not as wide as a digit; so the colons don’t line up.
After the colon comes a space, then an asterisk, then a tab. The difference in placement of the colons happens to be just enough that the tab for lines with single-digit numbers finds the next tab stop at a different position than the tab in lines with two-digit numbers.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login