Community
    • Login

    Feature Request - Toggle Line Numbers

    Scheduled Pinned Locked Moved General Discussion
    feature requestborderline number
    16 Posts 7 Posters 1.5k 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.
    • Alan KilbornA
      Alan Kilborn @drankinatty
      last edited by

      @drankinatty

      Please don’t create a new feature request for this. An open one already exists HERE.

      My guess is that developers don’t consider this an important enough item to act upon. Indeed, I don’t see why (a) someone wouldn’t want line numbers always visible, (b) why someone would want line numbers conditionally shown (related to “a” I guess), or © why this little bit of screen space couldn’t just be “ignored” by a user. But, I learned a long time ago, people want what they want.

      However, given all that, a scripting solution to this has been offered before. Details on that are HERE.

      As scripting involves a plugin, if you want to go with a plugin at all to solve this “problem”, probably first trying the one @Terry-R pointed out is the simplest thing.

      1 Reply Last reply Reply Quote 1
      • dinkumoilD
        dinkumoil @drankinatty
        last edited by

        @drankinatty @Terry-R @Alan-Kilborn

        Author of CustomLineNumbers plugin here. Unfortunately my plugin is not suitable for the mentioned use case. When the plugin gets deactivated, the default line number margin is activated again. Thus, it’s not possible to turn off line numbers with my plugin.

        1 Reply Last reply Reply Quote 3
        • PeterJonesP
          PeterJones @Terry R
          last edited by PeterJones

          @Terry-R said in Feature Request - Toggle Line Numbers:

          In your example it would make it much easier (quicker) with a shortcut key to achieve it.

          And unfortunately, keyboard shortcuts cannot be assigned to preference changes, and you cannot macro-record preferences changes, either.

          @drankinatty,

          The best bet for the feature that you asked for is to use the script that @Alan-Kilborn linked to, and to 👍 the existing feature request.

          But as a simpler alternative, if you’re really just using it to visually identify the line number for finding where errors are, you could just keep line numbers off, and use Ctrl+G (Search > Goto) and enter the line number that your compiler spits out at you. It won’t be as obvious as a number, but it will still take you to the right location in the file.

          If you do end up using the PythonScript plugin and the script that @Alan-Kilborn linked, make sure to follow his link to “further info on using the PS plugin may be obtained HERE”, as it will help you with getting things set up correctly.

          With PythonScript installed, you might also want to try out something like this other script by Alan which can run a syntax check (or your compiler) and set an “annotation” on the right line number in Notepad++, so that you can visually see the problem. Since Alan’s “annotation” script uses the internal python syntax checking, you might want to look at my variant of that script, which also runs an external command (in my case, wperl -c) to compile and syntax-check perl code; you could do something similar to run gcc or whatever compiler you need on .c or similar, then have the except block process the error messages from that compiler rather than wperl -c, similar to the way I show there. But this is just “extra”, which may or may not be of interest to you.

          Also, the NppExec plugin has automatic “filtering”/“error highlighting” (Plugins > NppExec > Console Output Filters > Highlight), so if you use NppExec to run your compiler, it can highlight error messages in its console, and if you double-click on the error there, it will take you to the right line of code in your file. It’s already set up for standard c-style error and warning messages … and if your compiler doesn’t follow the FILENAME:LINENUMBER:other pieces format that gcc uses, and you cannot understand the syntax shown, you could probably paste an error message in this discussion (make sure to use the </> button on the forum toolbar), and one of us will likely be able to share the right highlighting format for your specific style of error message.

          Alan KilbornA 1 Reply Last reply Reply Quote 3
          • Alan KilbornA
            Alan Kilborn @PeterJones
            last edited by

            This post is deleted!
            1 Reply Last reply Reply Quote 0
            • Neil SchipperN
              Neil Schipper @drankinatty
              last edited by

              @drankinatty

              I added this comment to Issue #10762:

              Only somewhat tangentially,

              1. promoting line number to a first class per-file attribute that persists across sessions is clearly not a priority, and this is understandable, however…
              2. double clicking on the line number column presently does nothing (different than single-clicking) so it seems to me that toggling line numbers visibility (thus sometimes overriding the Settings-Preferences directive) on a per-file but non-persistent basis by double-click should be “almost free” to code. When I say “almost free” I mean: no anguish over cluttering up any options dialogs; no extensions to session xml; and almost no need to document since folks nowadays will often double-click or right-click on a visual element just to see what happens; … which in turn suggests …
              3. Somewhat nicer still would be a right-click pop-up menu “Toggle line nums for this file” item
              Alan KilbornA drankinattyD 2 Replies Last reply Reply Quote 0
              • Alan KilbornA
                Alan Kilborn @Neil Schipper
                last edited by

                @Neil-Schipper said in Feature Request - Toggle Line Numbers:

                double clicking on the line number column

                OK, so double-clicking on the line number column will cause it to disappear, and to get it to reappear just what exactly do I double-click on??

                Neil SchipperN 1 Reply Last reply Reply Quote 0
                • Neil SchipperN
                  Neil Schipper @Alan Kilborn
                  last edited by

                  @Alan-Kilborn Persistent skinny margin.

                  Alan KilbornA 1 Reply Last reply Reply Quote 0
                  • Alan KilbornA
                    Alan Kilborn @Neil Schipper
                    last edited by

                    @Neil-Schipper said in Feature Request - Toggle Line Numbers:

                    Persistent skinny margin.

                    I see. So the line number margin is always visually available, just when it is “logically hidden” it still has some minimum visual component to allow restoration. I suppose if it is very minimal then it is hard to hit to restore it, but if it isn’t very minimal it doesn’t really achieve the goal of being hidden. Maybe as long as numbers aren’t visible the goal is achieved.

                    1 Reply Last reply Reply Quote 0
                    • drankinattyD
                      drankinatty @Neil Schipper
                      last edited by

                      @Neil-Schipper Neil, thank you and all that replied. and thank you for the FAQ link. I see you have added suggestions to #10762, if that is sufficient for the issue, then that’s good for me.
                      I understand features are added based on a user-support type system, and I’ve seen that in other projects as well. It has merit, but I agree that for smaller, specific features such as a line number toggle, it is unlikely that it will generate sufficient vote interest. (not much sex-appeal from a feature standpoint)
                      That is where the user-support (vote) system has its weakness. Many features are just those that are expected in any editor, the type where any one of the nuts-and-bolts features are unlikely to receive many “popular” votes for addition. That doesn’t mean the feature shouldn’t be added, moreover just that basic features are not the type that end up at the top of a users wish-list.
                      If you think it would be helpful for me to follow the FAQ further to put the issue before the developers, let me know and I’m happy to do it. Thanks again to all that replied.

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

                        Really, one could just use the script I linked to before and stop all the discussion. It works, end of story.

                        One of the main points of scripting is giving you control over things so you don’t have to wait for developers to agree that what you want is worth it, then wait even longer for then to code, document and release it.

                        drankinattyD 1 Reply Last reply Reply Quote 2
                        • drankinattyD
                          drankinatty @Alan Kilborn
                          last edited by

                          @Alan-Kilborn I installed PythonScript plugin. That really isn’t an efficient solution. Installing a 20M plugin just to toggle line-numbers on/off seem a bit overkill. (not to mention the additional vulnerability from having yet another part of npp automatically pulled from github - and being python - the recent Pypy attack is a reminder that isn’t always a good idea)

                          Lycan ThropeL Alan KilbornA 2 Replies Last reply Reply Quote 1
                          • Lycan ThropeL
                            Lycan Thrope @drankinatty
                            last edited by

                            @drankinatty,
                            The other option is to write your own plugin, or wait until one of the developers thinks it’s important enough to make part of the codebase.
                            There are always going to be “attacks” by malcontents. Your only true option to avoid this type of problem is to get a Smith Corona to do your text editing. Then you can control everything with no need for code.

                            1 Reply Last reply Reply Quote 3
                            • Alan KilbornA
                              Alan Kilborn @drankinatty
                              last edited by

                              @drankinatty said in Feature Request - Toggle Line Numbers:

                              I installed PythonScript plugin. That really isn’t an efficient solution. Installing a 20M plugin just to toggle line-numbers on/off seem a bit overkill.

                              I really can’t conversate rationally with someone that is going to complain about a 20MB usage in today’s world.

                              (not to mention the additional vulnerability from having yet another part of npp automatically pulled from github - and being python - the recent Pypy attack is a reminder that isn’t always a good idea)

                              Another irrational point – go with Smith Corona, as suggested?


                              We’re just N++ users here, attempting to point out ways in which you can obtain your desired functionality right this instant. Often these ways involve some sort of compromise on your part. Your alternative is to just go on missing the feature you are missing.

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