Not showing javascript styles

  • This is probably considered a minor problem, but it is really bugging me. I updated to the latest version of notepad++ and suddenly it is no longer detecting javascript files correctly and therefore it is retaining the default styles when viewing my .js files. In addition, even when I explicitly choose “Javascript” from the language list, the styles still do not change. Anything I can do to fix it?

    Also, I’ve been happily using notepad++ for all my web development needs for the past three and a half years plus, and plan to continue doing so. Thanks for the help!

  • I have a similar problem with javascript files, I don’t care about the styles though, but comment hotkeys stopped working for .js files after some recent update. I found that launching Notepad++ under admin account fixes this issue. This might help you too.

  • It seems to be fixed now in version 6.8.6. What version are you running?

  • It was specifically with the update to 6.8.6 that the problem started. Is there any more information I might be able to offer to help find the cause of this problem?
    @Андрей Черников I tried running Notepad++ as admin just now, and the problem persisted. Thank you for the idea.

  • Open Settings - Style Configurator. If you scroll down the list of languages you will notice there are 2 items for Javascript. The first item styles embedded Javascript (inside <script> element in HTML file) and the last item styles Javascript files.

  • Thank you very much, that’s exactly what I was looking for! I was able to fix the styles to my liking. Unfortunately, now it’s only adding background to the text on the page, but all whitespace is left with the default white background.

  • The whitespace in Javascript files picks up style from Global Styles:

    • Global override (depending what overrides you have enabled)
    • Default Style
    • Current line background (if Preferences - Editing - Enable current line highlighting is checked)

  • @Tatu-Rissanen I have the overrides disabled. I can verify that what you say is accurate, but I do not understand this behavior. Up until now, all my files had a default background color of white, and my js files had a different background color. Why is that no longer the case?

  • I don’t know why.

    The new Javascript language was added in Notepad++ version 6.8.4. I guess the author wanted the new Javascript DEFAULT style to behave similar to other languages. That is not overwriting the global default style for whitespace and areas after end-of-line or end-of-file.

  • @Tatu-Rissanen Ok, thank you very much for your help.

  • I am having this problem with javascript files in 6.8.8. I was fine before just installing. Issue occurs whether in as admin or not. Have to associate each file independently to get it to work. Would rather it recognizes it the .js extension and does it automatically.

Log in to reply