Copy only the not hidden text.
Kanagi last edited by
Hey, im trying to find out if there is a way to Copy every text in my file except for the ones i have hidden with ALT + H, if i copy them it also takes all the text thats hidden.
Thanks in advance
Alan Kilborn last edited by Alan Kilborn
Currently there is no way to do that without scripting. Hidden lines isn’t a fully fleshed-out feature in Notepad++.
Alan Kilborn last edited by
Currently there is no way to do that without scripting
Maybe something like this:
line_list =  (start_line, end_line) = editor.getUserLineSelection() for L in range(start_line, end_line + 1): if editor.getLineVisible(L): line_list.append(editor.getLine(L)) text = ''.join(line_list) editor.copyText(text)
Note that Scintilla doesn’t do a great job distinguishing lines hidden by code folding and lines hidden by the user, so if you have lines where folding is collapsed, they will NOT be copied by that script code.
guy038 last edited by
In addition to the Alan’s python script, I advice you to read this post first
Then, if not confidential, you could share with us some text with possible hidden parts and we’ll probably be able to find out some regexes to bookmark the non-hidden sections or the hiden ones !
See you later,