How do i unhide lines?
-
@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
-
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. :-(
-
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. -
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.
-
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.
-
@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.
-
@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”.
-
@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
. TheCtrl-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
. -
@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.
-
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. -
@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…
-
@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 forcount
iscontare
. However, Italian keyboards useNum
and so I’m still wondering. Maybe it’s AI generated nonsense? -
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.
-
@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.