• Login
Community
  • Login

How do i unhide lines?

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
15 Posts 5 Posters 4.3k 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.
  • M
    mkupper
    last edited by Nov 8, 2023, 5:57 PM

    This is with npp v8.5.8 though likely applies to many older versions.

    Among the things I have done to reduce the on-screen clutter I have turned off the display bookmark feature using Preferences / Margins-border-edge / Display bookmark.

    The display bookmark feature creates a blank area in the left margin. Turning display bookmark off means I can’t see the blue bookmark dots but I’m fine with that as bookmarks still work well.

    Today while working on a text file I fumble fingered Alt-H which is the shortcut to hide lines. A thin green line appeared in my document and I see from the line numbering that a line of my text file is not visible.

    I don’t see a View / Unhide line(s) menu option. I tried Shift+Alt+H, no joy. The same blank area that is used by the blue bookmark dots is also used by the green arrows used to unhide lines.

    Are there a ways to unhide lines other than re-enabling Display bookmark in preferences for a moment so I can click the green arrow, closing and re-opening the file, or closing and restarting Notepad++?

    This example file has ten lines of text with lines 4 to 7 hidden.
    Notepad++-line-5-hidden.png

    P 1 Reply Last reply Nov 8, 2023, 6:24 PM Reply Quote 1
    • P
      PeterJones @mkupper
      last edited by Nov 8, 2023, 6:24 PM

      @mkupper said in How do i unhide lines?:

      Are there a ways to unhide lines other than

      Not as far as I know, which seems to be confirmed because no one closed-with-answer this issue: https://github.com/notepad-plus-plus/notepad-plus-plus/issues/12717

      A 1 Reply Last reply Nov 8, 2023, 6:34 PM Reply Quote 1
      • A
        Alan Kilborn @PeterJones
        last edited by Alan Kilborn Nov 8, 2023, 8:01 PM Nov 8, 2023, 6:34 PM

        @mkupper

        I’ve commented a few times before that hidden lines is an underdeveloped feature. Use it if you will, but it will probably be just a short time before it disappoints you (again). :-(

        I have created official bug reports concerning hidden lines, but they haven’t been acted upon. :-(

        M 1 Reply Last reply Nov 8, 2023, 8:50 PM Reply Quote 1
        • M
          mkupper @Alan Kilborn
          last edited by Nov 8, 2023, 8:50 PM

          Thank you @PeterJones and @Alan-Kilborn

          I dug into the source code a bit and saw:

          	SCI_SHOWLINES	2226
          	SCI_HIDELINES	2227
          

          I tried to define an Alt+Shift+H Show lines macro using:

          <Macro name="Show lines" Ctrl="no" Alt="yes" Shift="yes" Key="72">
          	<Action type="0" message="2226" wParam="0" lParam="0" sParam="" />
          </Macro>
          

          in the <Macros> section of my shortcuts.xml but nothing happened when I tried to unhide. Maybe it’s supposed to be in the <InternalCommands> section but I don’t know if and how I can use SCI commands in that section. The existing ones all use IDM commands.

          A 1 Reply Last reply Nov 8, 2023, 8:54 PM Reply Quote 0
          • A
            Alan Kilborn @mkupper
            last edited by Alan Kilborn Nov 8, 2023, 8:58 PM Nov 8, 2023, 8:54 PM

            @mkupper

            Those commands I believe are going to take a line range as arguments. That makes it impractical for hiding lines, but if your goal is to show all lines, you might be able to pass it a zero and a “really big” line number in such a macro.

            But definitely see the user manual section on how the messages are encoded in shortcuts.xml, in order to satisfy Notepad++'s requirements (so the macro would even have a chance at working). Ref. HERE.

            1 Reply Last reply Reply Quote 1
            • A
              Alan Kilborn
              last edited by Alan Kilborn Nov 8, 2023, 9:52 PM Nov 8, 2023, 9:52 PM

              So taking it a bit further I changed @mkupper 's macro a bit to correspond to my additional information:

                  <Macro name="Show all lines" Ctrl="no" Alt="yes" Shift="yes" Key="72">
                      <Action type="0" message="2226" wParam="0" lParam="999999" sParam="" />
                  </Macro>
              

              Then I hid some lines and ran the macro. It appeared to do nothing, but then I switched the active tab and switched back to the tab where I had hidden the lines.

              Like magic those lines were shown again. But, the green arrows were still present in the bookmark margin. This makes sense as the Scintilla “show lines” is very “low level” and knows nothing about Notepad++ margins; it only knows about…ta dum…which lines are showing in the editing view.

              Bottom line: While a macro can be made to show lines, it leaves something to be desired.

              M 1 Reply Last reply Nov 9, 2023, 4:47 PM Reply Quote 1
              • M
                mkupper @Alan Kilborn
                last edited by Nov 9, 2023, 4:47 PM

                @Alan-Kilborn said in How do i unhide lines?:

                <Action type=“0” message=“2226” wParam=“0” lParam=“999999” sParam=“” />

                You must have been wearing the wizard hat. :-)

                I also had tried lParam=“999999” but had not thought about switching tabs and then back. However, I still can’t replicate the “Like magic those lines were shown again” part. I tried various ways of switching tabs such as via Window / Windows... menu.

                I tested this on v8.5.8 x32 installed and a fresh bare-bones v8.5.8 x64 portable. In both cases the lines remained hidden, and the green line plus arrows remain. I had run Show all lines both via the keyboard shortcut and the drop down menus.

                I would have to apprentice a few more decades before my head will fit in that wizard’s hat but am happy with that I understand this line hiding thing a bit better.

                A 1 Reply Last reply Nov 9, 2023, 5:44 PM Reply Quote 1
                • A
                  Alan Kilborn @mkupper
                  last edited by Nov 9, 2023, 5:44 PM

                  @mkupper said in How do i unhide lines?:

                  However, I still can’t replicate the “Like magic those lines were shown again” part.

                  Hmm, I tried in a fresh 8.5.8 64bit portable and I can’t replicate it now either. Sorry for the misdirection.

                  Maybe we should just chalk it up to “can’t do it this way”.

                  M 1 Reply Last reply Nov 16, 2023, 6:03 PM Reply Quote 2
                  • M
                    mkupper @Alan Kilborn
                    last edited by Nov 16, 2023, 6:03 PM

                    @PeterJones and @Alan-Kilborn, a thought that had floated in and out at times what I was not near a computer resurfaced today. I had been wondering if hiding lines also blocks selections and copy/paste. It turns out it doesn’t meaning to unhide or show the text that we can select a range of text from before to after the hidden line(s) and then do Ctrl-C Ctrl-V Ctrl-Z. The Ctrl-Z is not essential but it will clear the file dirty or modified flag.

                    I’m not sure if we’d call it a Notepad++ bug or a feature that hidden lines are included when making a selection.

                    Experimenting finds that, for example, a column mode selection also column-selects data in the hidden lines and that operations such as delete, replace, etc. also affect the hidden lines. When doing column mode work the lines remain hidden.

                    This could be useful. Let’s say you want to do column mode work on a very long series of lines. Select and hide all of the lines except the first and last. Do a column mode selection on the two visible lines. Now do whatever you want in column mode. The hidden lines remain hidden. To reveal the results do a normal (non-column) selection of the two visible lines and then do Ctrl-C Ctrl-V Ctrl-Z.

                    A 1 Reply Last reply Nov 17, 2023, 11:57 AM Reply Quote 3
                    • A
                      Alan Kilborn @mkupper
                      last edited by Nov 17, 2023, 11:57 AM

                      @mkupper said in How do i unhide lines?:

                      I’m not sure if we’d call it a Notepad++ bug or a feature that hidden lines are included when making a selection

                      Some people think it is a bug, some think it isn’t.

                      I’m reminded of the case where some lines are “hidden” because of “folding”. (Scintilla considers folded lines as hidden, another “problem” with the hidden-lines feature IMO).

                      Anyway, users have folded lines and they want to cut the folded block to move it somewhere else. They don’t understand that you can’t just select the line with the + on its left and get the whole block in the cut. You have to select across that line’s line-ending as well (so caret shows on line beneath the line with the +), before cutting. When you do that, you see the effect that you pointed out, i.e., that folded/hidden lines are actually part of selected text.

                      I suppose that there could be a command made that would copy/cut/etc only selected text that you can see, i.e., ignoring embedded hidden lines, but, as I stated before, hidden lines is such an underdeveloped feature generally that that kind of mod to it in its current state is of limited value.

                      1 Reply Last reply Reply Quote 2
                      • M
                        Michael Seden
                        last edited by May 4, 2024, 2:04 PM

                        Here is what I did to recover the hide lines mistake after reading this chat.

                        I did Macro>Modify Shortcut/Delete Macro>Macros>Main Menu>Show All Characters.
                        When the Pop-up window appeared created a shortcut of SHIFT+ALT+CON+0 and hit OK.
                        I closed the Macro window and ran my shortcut 2 times.

                        A 1 Reply Last reply May 4, 2024, 3:07 PM Reply Quote -1
                        • A
                          Alan Kilborn @Michael Seden
                          last edited by May 4, 2024, 3:07 PM

                          @Michael-Seden said in How do i unhide lines?:

                          Here is what I did to recover the hide lines mistake after reading this chat.

                          I did Macro>Modify Shortcut/Delete Macro>Macros>Main Menu>Show All Characters.

                          What you did had nothing to do with showing hidden lines…

                          M 1 Reply Last reply May 4, 2024, 3:43 PM Reply Quote 2
                          • M
                            mkupper @Alan Kilborn
                            last edited by May 4, 2024, 3:43 PM

                            @Alan-Kilborn said:

                            What you did had nothing to do with showing hidden lines…

                            After thinking about what the CON key is I think it’s a non-English translation issue that lead to misunderstanding the question. It’s a stretch but Italian for count is contare. However, Italian keyboards use Num and so I’m still wondering. Maybe it’s AI generated nonsense?

                            GrampaWildWillyG 1 Reply Last reply Sep 21, 2024, 3:08 AM Reply Quote 0
                            • GrampaWildWillyG
                              GrampaWildWilly @mkupper
                              last edited by Sep 21, 2024, 3:08 AM

                              I was just experimenting with hiding some lines because I wanted to see a bunch of unhidden lines side by side to get a better sense of what I was looking at. The text in question was an ffprobe report that had over 20 Programs & I wanted to see only the Stream lines so I could understand what I was looking at. Then I wanted to unhide the lines. The only way I could find was to click the little icons in the left side of the N++ window next to the line numbers. I thought surely there’s an inverse function for this. Surely I don’t have to click each one over & over. I tried to search the online manual & didn’t find any help. When I came here, I found this discussion. Sadly, you confirm my suspicion that such a function does not exist. Hiding lines is an “underdeveloped” (to use your word) feature. Most disappointing. If this is a place where I can vote, I vote that this turn into a better developed feature. It seems pretty much a no-brainer that hide should have an unhide function, & it should be possible to do it from the keyboard, totally mouselessly.

                              M 1 Reply Last reply Sep 26, 2024, 8:32 PM Reply Quote 0
                              • M
                                mkupper @GrampaWildWilly
                                last edited by Sep 26, 2024, 8:32 PM

                                @GrampaWildWilly The FAQ: Feature Request or Bug Report shows the best (and only) way to request and, or, to vote, on feature requests.

                                On github I see six open issues when I search for “unhide” Unfortunately, most of the issues seem to be related to conflicts between hiding lines and other Notepad++ features.

                                Maybe there’s an issue in there asking for just the ability to unhide a selection. I did not see it.

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