Community
    • 登入

    Tia ; Is there a pluggin to colorize .js files ?

    已排程 已置頂 已鎖定 已移動 Notepad++ & Plugin Development
    18 貼文 4 Posters 3.5k 瀏覽
    正在載入更多貼文
    • 從舊到新
    • 從新到舊
    • 最多點贊
    回覆
    • 在新貼文中回覆
    登入後回覆
    此主題已被刪除。只有擁有主題管理權限的使用者可以查看。
    • vmars vernonV
      vmars vernon
      最後由 編輯

      Tia ;
      Is there a pluggin to colorize .js files ?
      Like there is for .html files .
      Thanks

      PeterJonesP Krishna JK 2 條回覆 最後回覆 回覆 引用 0
      • PeterJonesP
        PeterJones @vmars vernon
        最後由 編輯

        @vmars-vernon ,

        Yes. Open a .js file. It should pick Language > J > JavaScript (or Language > JavaScript) automatically.

        Is that not working for you? What if you manually select the Language … JavaScript?

        If it’s not working for you, please share your ? menu’s Debug Info

        1 條回覆 最後回覆 回覆 引用 1
        • vmars vernonV
          vmars vernon
          最後由 編輯

          @PeterJones said in Tia ; Is there a pluggin to colorize .js files ?:

          If it’s not working for you, please share your ?
          Yes , highlighting for .js in not working , I don’t know how to do any debugginh . Under ‘Language’ the .js is highlighted .
          So it knows file is .js .
          Thanks

          PeterJonesP 1 條回覆 最後回覆 回覆 引用 0
          • PeterJonesP
            PeterJones @vmars vernon
            最後由 編輯

            @vmars-vernon said in Tia ; Is there a pluggin to colorize .js files ?:

            Yes , highlighting for .js in not working ,
            I don’t know how to do any debugginh .

            You go to the menu called ? and click on Debug Info.
            28ac489d-a2df-483c-a775-69ec155d7efa-image.png

            58515abc-e422-4d3a-8425-e3ab25c83c05-image.png

            Then you click on “Copy debug info into clipboard”, and paste it in your reply.

            Under ‘Language’ the .js is highlighted .
            So it knows file is .js .

            So what’s wrong? Can you Alt+PrintScreen and post a screenshot? Because the JavaScript lexer correctly does syntax highlighting for me.

            1 條回覆 最後回覆 回覆 引用 1
            • vmars vernonV
              vmars vernon
              最後由 編輯

              Debug info:
              Notepad++ v7.9 (32-bit)
              Build time : Sep 22 2020 - 03:24:22
              Path : C:\Program Files (x86)\Notepad++\notepad++.exe
              Admin mode : OFF
              Local Conf mode : OFF
              OS Name : Windows 10 Home (64-bit)
              OS Version : 1903
              OS Build : 18362.959
              Current ANSI codepage : 1252
              Plugins : MarkdownViewerPlusPlus.dll mimeTools.dll NppConverter.dll NppExport.dll NppMarkdownPanel.dll

              1 條回覆 最後回覆 回覆 引用 0
              • PeterJonesP
                PeterJones
                最後由 PeterJones 編輯

                @vmars-vernon ,

                I see you are impatiently waiting for more help. Since you only provided half of what I’d asked for, it seems rather rude for you to get impatient about it – you gave the debug info, but not the screen shot.

                The JavaScript lexer correctly colorizes for me. Until you can show us how it’s not working for you, we cannot help you:
                3820c56a-6848-4e71-aae5-b7eac4ba838a-image.png

                For other trouble shooting: go to Settings > Style Configurator: what is your theme? If it’s not the default, try to change the Theme to Default (stylers.xml). If this makes JavaScript colorize, then the problem is with your chosen theme not definining the JavaScript file type colors. If this is the culprit, let us know, and we can walk you through how to make the change to the theme config file to tell it about the JavaScript file type.

                vmars vernonV 1 條回覆 最後回覆 回覆 引用 3
                • Krishna JK
                  Krishna J @vmars vernon
                  最後由 編輯

                  @vmars-vernon - Thanks

                  1 條回覆 最後回覆 回覆 引用 0
                  • vmars vernonV
                    vmars vernon @PeterJones
                    最後由 編輯

                    PeterJones notepad++_J2fxTIU1VF.png
                    Thanks

                    PeterJonesP 1 條回覆 最後回覆 回覆 引用 0
                    • PeterJonesP
                      PeterJones @vmars vernon
                      最後由 PeterJones 編輯

                      @vmars-vernon ,

                      It works for me.

                      When I type that exact code and save as browser.js, it correctly highlights the syntax:
                      e18e636c-3be5-4f0b-a8e0-44d09feddd30-image.png

                      You didn’t answer my question about what theme you’re using. You didn’t answer my question as to whether switching to Default (stylers.xml) worked for you. You are going to need to answer all requests-for-info asked of you, or we are not going to be able to help you.

                      1. Please confirm that the lower corner of your window says “JavaScript file” like mine does. If it does not, then it has not selected the correct parser. Doing an Alt+PrintScreen or use the Windows Snipping Tool (Shift+WindowsKey+S) to grab a screenshot like the above, and paste it here, to show whether Notepad++ has recognized that browser.js is JavaScript or not.

                      2. Please go to the Settings > Style Configurator, click on JavaScript in the Language: column, and INSTRUCTION WORD in the Style: column, then hit Alt+PrintScreen or use Snipping Tool to give us the full Style Configurator dialog, like I have shown here:
                        80ba1599-70ef-4339-80c3-ab8c30d36a53-image.png
                        please note that the INSTRUCTION WORD includes the color info for function(), which I have shown as properly highlighted; this will give us a clue as to what’s going wrong with yours.
                        If yours does not have the JavaScript language entry, or if the Styles listed are different, then you probably have an outdated config file… but we’ll have to wait for your reply to know for sure.

                      If you don’t answer both of these questions, I will not be able to help you further.

                      1 條回覆 最後回覆 回覆 引用 1
                      • vmars vernonV
                        vmars vernon
                        最後由 編輯

                        Sorry I got behind:
                        notepad++_JDGkV7NYC7.png notepad++_Uws56YA3TM.png notepad++_dkuf8Dkqxs.png
                        Thanks

                        PeterJonesP 1 條回覆 最後回覆 回覆 引用 0
                        • PeterJonesP
                          PeterJones @vmars vernon
                          最後由 編輯

                          @vmars-vernon ,

                          The style configurator shows you’re using the default style, and you’ve got the same color as I showed for the INSTRUCTION WORD, so that’s configured properly.

                          Unfortunately, you may have noticed that there was a difference in the lower-left corner of the status bar on yours vs. mine in the full-notepad++ screenshot: mine shows the language (file type), yours does not. The status bar hides the file type field when the window is too narrow. So unfortunately, it hid the information I was looking for – whether Notepad++ is truly recognizing that particular file as JavaScript. Can you widen your Notepad++ window until the status bar shows either Normal text file or JavaScript file or XXXXXX file, and take a new screenshot?

                          The other experiment you could run is to close all Notepad++ windows, download the portable v7.9-32bit (download link here), unzip to a folder on your desktop, run Notepad++ from that folder, File Open c:\Electron-js\Best-Electron-Browser\browser.js, and see if a fresh copy correctly colorizes the javascript for you or not. (It does for me, obviously). If it works on the portable but not on your installed copy, then there is some configuration difference between the two, which we’ll help you through debugging.

                          1 條回覆 最後回覆 回覆 引用 1
                          • vmars vernonV
                            vmars vernon
                            最後由 編輯

                            ckHDNCoBSh.png notepad++_exNhe7Ql0Z.png

                            PeterJonesP 1 條回覆 最後回覆 回覆 引用 0
                            • PeterJonesP
                              PeterJones @vmars vernon
                              最後由 編輯

                              @vmars-vernon ,

                              My best guess is still that you’ve got a weird config file problem. The experiment using the portable edition will help shed more light.

                              If anyone else wants to chime in with other ideas, feel free.

                              1 條回覆 最後回覆 回覆 引用 0
                              • vmars vernonV
                                vmars vernon
                                最後由 編輯

                                I just Restarted my system
                                and reDownloaded np++Portable
                                and re-do on all your suggestions
                                and voila , np++Portable works fine for .js .
                                Thank you very much !
                                KmT1pHJvTg.png

                                PeterJonesP 1 條回覆 最後回覆 回覆 引用 1
                                • PeterJonesP
                                  PeterJones @vmars vernon
                                  最後由 編輯

                                  @vmars-vernon ,

                                  Glad it worked.

                                  If you don’t have any settings you care about from your installed version, you could just go to and delete the whole %AppData%\Notepad++\ folder and let Notepad++ re-create the configs with default settings. If you do care about previous settings, it will take some effort on your part to determine which config file is the cause: I would suggest something like: rename %AppData%\Notepad++ to %AppData%\Notepad++.old\, launch Notepad++ to re-create configs with defaults, then one-at-a-time, exit notepad++ and copy one config file from .old to the new folder and rerun notepad++ until it stops highlighting JS; once you find the culprit, you can compare the old vs default config files and try to figure out what setting was the culprit. But it might be easier for you to just start from the fresh config on your installed copy, and then change the settings back to the way you like it from within Notepad++ GUI itself.

                                  Let us know if you need more help with that process. Make sure to provide details on exactly how far you’ve gotten.

                                  1 條回覆 最後回覆 回覆 引用 2
                                  • vmars vernonV
                                    vmars vernon
                                    最後由 編輯

                                    I don’t really know what this is %AppData%\Notepad++\
                                    so I searched for it in files :

                                    AgentRansack_hSrKPVb8tP.png

                                    I guess that’s all normal .
                                    Think I’ll just tip toe away :)
                                    Thanks

                                    Alan KilbornA PeterJonesP 2 條回覆 最後回覆 回覆 引用 0
                                    • Alan KilbornA
                                      Alan Kilborn @vmars vernon
                                      最後由 Alan Kilborn 編輯

                                      @vmars-vernon said in Tia ; Is there a pluggin to colorize .js files ?:

                                      I don’t really know what this is %AppData%\Notepad++\

                                      In Windows Explorer, type %appdata% here:

                                      00ab5886-96dc-440b-875b-eedb27c41dcf-image.png

                                      and press Enter.

                                      You will be jumped to a display like this where you can see the Notepad++ folder @PeterJones mentioned:

                                      90fd6f07-f770-4fa6-afe8-53ef0dfa9378-image.png

                                      1 條回覆 最後回覆 回覆 引用 1
                                      • PeterJonesP
                                        PeterJones @vmars vernon
                                        最後由 編輯

                                        @vmars-vernon said in Tia ; Is there a pluggin to colorize .js files ?:

                                        I don’t really know what this is

                                        There’s a FAQ in this Forum on that: https://community.notepad-plus-plus.org/topic/15740/faq-desk-what-is-appdata

                                        Do people not check FAQ of a forum anymore?

                                        1 條回覆 最後回覆 回覆 引用 2
                                        • 第一個貼文
                                          最後的貼文
                                        The Community of users of the Notepad++ text editor.
                                        Powered by NodeBB | Contributors