"&" characters in JavaScript code are rendered as blanks



  • See this screen shot for a weird little NPP quirk.

    • Line 81 shows the quirk: The blank spaces after ’ == “original” ’ actually contain “&&”, the JS symbol for the logical-and operator.
    • Line 82 is a copy of line 81, but commented out. Note that the “&&” appears there.
    • Line 83 illustrates that other JS characters - in this case, the “||” representing the logical-or operator, show up just fine. As far as I can tell, “&” is the only character subject to this quirk.
    • Also, when I copy line 81 to a new NPP document that is not labeled as a JS file, the “&&” characters appear intact. So the quirk seems to reside in the NPP function that interprets the text typed in as Javascript.

    This is only a display issue: The code of line 81 runs just fine.



  • @Ken-Winter

    Can you post your debug-info which is available in the last menu item, the ? menu?
    I tried it with my npp and I don’t see the reported behavior, meaning I see the &&



  • This bug use to show up a while ago. The font you are using doesn’t support bold & so it does not display them.



  • Notepad++ v7.7.1 (32-bit)
    Build time : Jun 16 2019 - 21:14:50
    Path : C:\Program Files (x86)\Notepad++\notepad++.exe
    Admin mode : OFF
    Local Conf mode : OFF
    OS : Windows 7 (64-bit)
    Plugins : DSpellCheck.dll mimeTools.dll NppConverter.dll NppExport.dll



  • @Ken-Winter

    Based upon @dail 's statement of:

    The font you are using doesn’t support bold & so it does not display them.

    Did you try a different font, Ken?



  • @dail, can you tell me how to set NPP for a different font? I can’t find the font option anywhere in the menus.



  • @Ken-Winter

    Settings (menu) > Style Configuator…

    See if you can change the global font. It isn’t the most user-intuitive thing to set up, unfortunately.

    BTW a lot of people have success in Notepad++ with the “Consolas” font.


Log in to reply