Community
    • Login

    Is it possible to keep a block folded when cutting and pasting?

    Scheduled Pinned Locked Moved General Discussion
    6 Posts 4 Posters 361 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.
    • pbarneyP
      pbarney
      last edited by

      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.

      PeterJonesP rdipardoR 2 Replies Last reply Reply Quote 0
      • PeterJonesP
        PeterJones @pbarney
        last edited by PeterJones

        @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 to Ctrl+Shift+V for paste-then-fold

        pbarneyP 1 Reply Last reply Reply Quote 3
        • rdipardoR
          rdipardo @pbarney
          last edited by

          @pbarney

          There’s a plugin that might be useful in this case:

          npp_x64_htmltag_v123.gif

          pbarneyP 1 Reply Last reply Reply Quote 3
          • pbarneyP
            pbarney @rdipardo
            last edited by pbarney

            @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.

            1 Reply Last reply Reply Quote 0
            • pbarneyP
              pbarney @PeterJones
              last edited by

              @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.

              1 Reply Last reply Reply Quote 0
              • apk shelfA
                apk shelf
                last edited by

                This post is deleted!
                1 Reply Last reply Reply Quote -1
                • First post
                  Last post
                The Community of users of the Notepad++ text editor.
                Powered by NodeBB | Contributors