Community
    • Login

    Comments don't work?

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    comment bugs
    19 Posts 7 Posters 21.6k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Paul VornP
      Paul Vorn
      last edited by

      Comment doesn’t work? I’ve been using Notepad++ for years. I use it mostly to edit Javascript. For the past few updates the Alt-Q shortcut and commenting lines has intermittently not worked. Now, with the latest version it’s not working at all. What’s up? I can’t even use the pull down menu to comment lines. Help!?!

      Claudia FrankC 1 Reply Last reply Reply Quote 0
      • Claudia FrankC
        Claudia Frank @Paul Vorn
        last edited by

        @Paul-Vorn

        just for information, not EVERY language is supporting the block comment although java script supports it.

        Can you describe in more detail what exactly happens when bringing up the context menu.
        Doesn’t it work at all? Are parts disabled? For any language?
        Can you post the debug-info?
        Maybe, temporarily and only if used, rename %APPDATA%\notepad++ directory and start npp again.

        Cheers
        Claudia

        1 Reply Last reply Reply Quote 1
        • PeterJonesP
          PeterJones
          last edited by

          Are you sure you have the correct shortcuts? You said Alt-Q, but my Edit > Comment/Uncomment submenu shows Ctrl-Q on my installation, not Alt-Q. And the Settings > Shortcut Mapper > Main menu entries agree.

          That screenshot was from NPP 7.2.2. But when I noticed you claimed “latest version”, I finally download 7.3.1 (which still hasn’t auto-updated for me), and confirmed the same.

          Looking at ? > Debug Info > Copy debug info into clipboard:

          Notepad++ v7.3.1   (32-bit)
          Build time : Jan 17 2017 - 00:21:10
          Path : C:\Program Files (x86)\Notepad++\notepad++.exe
          Admin mode : ON
          Local Conf mode : OFF
          OS : Windows 7
          Plugins : ComparePlugin.dll dbgpPlugin.dll mimeTools.dll NppConverter.dll NppExec.dll NppExport.dll NppFTP.dll NppTextFX.dll PluginManager.dll PythonScript.dll 
          

          Once 7.3.1 was installed I tried: File > New, Language > J > JavaScript, typed var a=1;, then tried out the Ctrl-Q toggling, Ctrl-K multiple times to add multiple levels of single-line comment, Ctrl-Shift-K multiple times to clear them, and Ctrl-Shift-Q to use a block comment, and they all worked exactly as expected. (As did going to the Edit > Comment/Uncomment, and selecting each of the five entries.) I then changed to a different lanugage (Perl), which uses different comments, and it still did what I expected.

          Please

          • Confirm whether the shortcuts you are typing match the shortcuts listed in the menu and shortcut mapper
          • Confirm whether using the menu version of the comment commands do what you expect, or not
          • Confirm which version of NPP and plugins you have by looking at the Debug Info.

          If you are able to get it work, great, glad to help. If not, please make similar screenshots to what I’ve done, post them on a sharing site like imgur.com, and embed the images using the notation, and explain why you think the behavior is still wrong.

          ![](http://i.imgur.com/FzoYBAO.png)
          
          1 Reply Last reply Reply Quote 2
          • Alan KilbornA
            Alan Kilborn
            last edited by

            So I have not seen much of a need for these “comment” commands:

            For a single line, is it really necessary to invoke this command? Perhaps for the C style /* and */ on a single line it is of some use, but do people really use that these days instead of // ? Instead of invoking the command, just put the // © or # (Python) or “whatever” on MANUALLY YOURSELF. :-)

            For a selected block, in the language I use (Python), invoking the Comment command puts a # at the start of the non-whitespace text on every line…well, OK, but if I’m doing it myself I would probably put a three ’ or " chars above the first line and below the last line of my desired block. Worse, though, for the # on every line approach done by “Block Comment” is that the “Block Uncomment” does nothing!

            Am I missing the value here? Can someone explain it to me?

            Claudia FrankC 1 Reply Last reply Reply Quote 0
            • Paul VornP
              Paul Vorn
              last edited by

              Thanks for the replies, and yes, I meant “CTRL - Q” as a shortcut for comment / uncomment.

              I’m writing code for Unity3D in Javascript. Been using Notepad++ for about 8 years for this. When I highlight a block of code, I press “CTRL” and “Q” to comment or un-comment that block of code. Sometimes it works, but most of the time it doesn’t. I also tried using the top pull down menu to comment / un-comment the code. That doesn’t work. I tried selecting only a single line of code. That doesn’t work. I tried closing Notepad++ and then relaunching it. That didn’t fix it. I checked the Short Cut mapper, and yes, “CTRL - Q” is there.

              I only started seeing this issue late last year when I updated Notepad++. Earlier today I updated again hoping the update would fix it only to find it’s even worse. This is driving me nutz!

              1 Reply Last reply Reply Quote 0
              • PeterJonesP
                PeterJones
                last edited by

                Unfortunately, it’s hard to debug your problem for you, since we cannot replicate your problem.

                Maybe it’s one of your plugins. If you’d give us your ? > Debug Info, it lists the plugins you have installed, and maybe a user here would recognize one with an instability.

                If you try running notepad++ -noPlugin, NPP will load with no plugins, and if that makes it reliable, then probably one of your plugins is interfering. You could then enable one plugin at a time by renaming all the .dll in your installation’s notepad++\plugins subdirectory – if you rename all but one to .xdllx, then only the one will be enabled; if you go thru having only one .dll at a time, you can find which plugin is causing the instability.

                1 Reply Last reply Reply Quote 0
                • Paul VornP
                  Paul Vorn
                  last edited by

                  I completely un-installed Notepad++ and installed a fresh new copy. So far it seems to be working. The new install is the 64 bit version, the old install was 32 bits.

                  1 Reply Last reply Reply Quote 0
                  • Paul VornP
                    Paul Vorn
                    last edited by

                    I might know what was causing the problem. I have been using a custom language definition for UnityScript (a version of Javascript) that was created by the Unity3D community 6 or 7 years ago. When I did the clean install, I removed all my old settings, including that custom language. I’ve been using this updated / clean version for several hours and so far no issues. I can’t think of any other reason why I would have problems while no one else seems to.

                    1 Reply Last reply Reply Quote 1
                    • PeterJonesP
                      PeterJones
                      last edited by

                      If you’re interested in further debug (and I won’t be offended if you aren’t), you could try just installing that one plugin, and see if it really is the culprit. If you’re not interested, I’m at least glad it seems to be working for you. Enjoy.

                      1 Reply Last reply Reply Quote 0
                      • Paul VornP
                        Paul Vorn
                        last edited by

                        Unfortunately, I spoke too soon. After not running into any issues after the fresh install yesterday, today when I started it back up I can’t use the CTRL-Q toggle to comment / un-comment. Same issue as before. :( Here’s the contents of the debug window:

                        Notepad++ v7.3.1 (64-bit)
                        Build time : Jan 17 2017 - 00:28:43
                        Path : C:\Program Files\Notepad++\notepad++.exe
                        Admin mode : OFF
                        Local Conf mode : OFF
                        OS : Windows 7
                        Plugins : mimeTools.dll NppConverter.dll

                        1 Reply Last reply Reply Quote 0
                        • Paul VornP
                          Paul Vorn
                          last edited by

                          I’ve just installed Notepad++ version 6.0 to see if it works any better than the newer versions. As I posted at the beginning of this thread, I’ve been using Notepad++ without issues for years and only started seeing this issue when I updated last year.

                          1 Reply Last reply Reply Quote 0
                          • Finley DabinettF
                            Finley Dabinett
                            last edited by

                            I believe it has something to do with auto-reloaded files. What I mean by this is, when you open notepad++ then open a file, the commenting feature works fine. But if you keep that file open and close the notepad++ program then relaunch it, the file will be automatically open, and that is when the commenting does not work. But, if you re-open the file, it will work again.

                            So basically, files that are opened on launch of the notepad++ application have some issue with commenting using the shortcut.

                            Claudia FrankC Larry BellL 2 Replies Last reply Reply Quote 1
                            • Claudia FrankC
                              Claudia Frank @Finley Dabinett
                              last edited by

                              @Finley-Dabinett

                              Tested it - I do not have that behavior.
                              Must be something else.

                              Cheers
                              Claudia

                              1 Reply Last reply Reply Quote 0
                              • Claudia FrankC
                                Claudia Frank @Alan Kilborn
                                last edited by Claudia Frank

                                @Alan-Kilborn

                                So I have not seen much of a need for these “comment” commands:

                                To be honest - I use ctrl-k (and shift+ctrl+k) exclusively.
                                If you are at the position where you can put in a hash ( to stay with the python example) then
                                yes, of course, it would be quicker, but I’m almost never at that position.

                                Am I missing the value here?

                                No, it’s just not implemented - but as said, I don’t care I just have to remember two shortcuts,
                                well, not true, three shortcuts (I use toggle comment often also). Single line un-/comment and
                                toggle line comment. They work for blocks as well. ;-)

                                Cheers
                                Claudia

                                Alan KilbornA 1 Reply Last reply Reply Quote 1
                                • Alan KilbornA
                                  Alan Kilborn @Claudia Frank
                                  last edited by

                                  @Claudia-Frank

                                  Your statements make a lot of sense. I think I understand now. I have been using the ‘toggle’ shortcut key since I saw your reply and I LIKE IT. I think I was wanting the “block” version of the command to work, but since the toggle works for single lines or blocks I can just ignore (not use) the block version. Many thanks!

                                  1 Reply Last reply Reply Quote 0
                                  • Larry BellL
                                    Larry Bell @Finley Dabinett
                                    last edited by

                                    @Finley-Dabinett I agree. That is the behavior I am having too. In addition, I changed my mapping for Single Line Comment to another key combination and now my CTRL+K puts a VT in a black box on the page. So there is probably a conflict somewhere even though the mapper says there isn’t any conflicts.

                                    1 Reply Last reply Reply Quote 0
                                    • PeterJonesP
                                      PeterJones
                                      last edited by PeterJones

                                      No, there is no shortcut conflict. If Ctrl+K is assigned to nothing, it will go back to it’s extremely ancient mapping, which is VT (char 11, 0x0B). Just like Ctrl+J is LF, Ctrl+M is CR, Ctrl+H is BS, and Ctrl+I is TAB.

                                      (Ctrl+M, Ctrl+H and Ctrl+I all behave just like their ENTER, BACKSPACE, and TAB key equivalents in something like cmd.exe)

                                      1 Reply Last reply Reply Quote 0
                                      • Dennis ParoutsasD
                                        Dennis Paroutsas
                                        last edited by Dennis Paroutsas

                                        I found my way around it. I just created two new shortcuts, like this:

                                        1. First, I hilighted a whole line.
                                        2. Then started recording a new “Macro”.
                                        3. I cutted the line to the clipboard (ctrl-x).
                                        4. Then i printed two slashes “//”.
                                        5. Then i pasted the cutted line again (ctrl-v).
                                        6. Then paused recording, assinged the shorcut Alt-A (so it can be eazy with my left hand)
                                        7. Lastly I named it “Comment_Line_In_Javascript” and voila!!!
                                          Now when I press “alt-A” comments any line i want.

                                        I also did the same for block of lines. (Highlight the block, cut it, type “/*”+enter, paste in again, type “*/”+enter, save with Alt-Q, and that’s it!!!

                                        Alan KilbornA 1 Reply Last reply Reply Quote 0
                                        • Alan KilbornA
                                          Alan Kilborn @Dennis Paroutsas
                                          last edited by

                                          @Dennis-Paroutsas

                                          It does work, but it isn’t (and can’t be) language aware.
                                          Thus if you always program in C-style languages you are all set.
                                          But if you code in several different languages you’d have to have different macros and different keycombos that invoke them.

                                          And, you have to highlight a line (or a block) before running the macro. It’s arguably easier to just press / and / and achieve the same thing, with no follow-on caret positioning needed.

                                          1 Reply Last reply Reply Quote 1
                                          • First post
                                            Last post
                                          The Community of users of the Notepad++ text editor.
                                          Powered by NodeBB | Contributors