Bugfix for #3958: Filename rendered incorrectly to tab bar when filename...
Notepad++ project is moving to GitHub:
Brought to you by:
donho
Function DrawText interprets & as a prefix character and renders it as an underscore. Adding DT_NOPREFIX flag disables processing of prefix characters and fixes rendering bug.
Also fixes bug #4088 (duplicate).
I found out that this patch won't render all filenames correctly. In some cases (for example filename "&& && &&.txt") the tab bar's width won't be enough for the text, so the text won't fit in the tab bar nicely. I will try to fix this problem soon.
I also found some duplicate bug reports for this bug:
http://sourceforge.net/p/notepad-plus/bugs/1652/
http://sourceforge.net/p/notepad-plus/bugs/2177/
http://sourceforge.net/p/notepad-plus/bugs/2306/
http://sourceforge.net/p/notepad-plus/bugs/2583/
http://sourceforge.net/p/notepad-plus/bugs/2631/
http://sourceforge.net/p/notepad-plus/bugs/3012/
http://sourceforge.net/p/notepad-plus/bugs/3153/
http://sourceforge.net/p/notepad-plus/bugs/3233/
I also found this closed bug report for this same problem:
http://sourceforge.net/p/notepad-plus/bugs/524/
I finally managed to fix previous problem. Unfortunately tab control doesn't have NOPREFIX style, so I had to fix this problem harder way. Duplicating every ampersand and using DrawText without DT_NOPREFIX style created too width tabs in cases where there were multiple continuous ampersands. Only way to make tabs width correct was to encode each tabs name so that every first ampersand is duplicated. In printing this encoding is reversed.
I also had to manually create tooltips to give them TTS_NOPREFIX style, so that ampersands will be displayed correctly in them.
Last edit: Pekka Pöyry 2013-01-05
Hi Pekka,
Thank you for your contribution.
It has been committed in SVN rev.1349, and will be in the next release.
Sorry for the long time waiting.
Don