Is it possible to keep a block folded when cutting and pasting?
-
I’m dealing with a large HTML file that has many divs that need to be resorted by hand. It’s made much easier by folding the entire file to the appropriate level (in my case, by using
alt-5
), but when I cut a folded block and then paste it into it’s new location, it pastes unfolded.I don’t think this is possible in N++, given that line bookmarks also don’t copy and paste, but I thought I’d ask here first.
-
@pbarney said in Is it possible to keep a block folded when cutting and pasting?:
I don’t think this is possible in N++
Yeah, you are right: it’s not currently possible. To keep that kind of metadata through cut/paste actions would add a new layer or two of complexity (including the hijacking of messages that are currently passed directly to the underlying library that handles the cut/copy/paste… shudder) – and I’m thus doubtful that a feature request for that would be successful.
You could record a macro that includes PASTE then UP-ARROW (to move back into the block from your paste, since a folded-paste will end with a newline puting your caret outside the block) then FOLD CURRENT LEVEL, and save it to a keystroke (like
Ctrl+Shift+V
for “modified paste”, or whatever shortcut you’d like) – then just train yourself toCtrl+Shift+V
for paste-then-fold -
-
@rdipardo thank you! I currently use that plugin, specifically for the
CTRL+T
functionality (grateful for that!), but how might it help me with the folding/unfolding issue?By the way, your image hosting provider apparently pulled the image you pasted.
-
@PeterJones said in Is it possible to keep a block folded when cutting and pasting?:
You could record a macro
Excellent idea! I’ll do just that. Thank you.
-
This post is deleted!