Community
    • Login

    [feature requet] New Selected Multiple Documents

    Scheduled Pinned Locked Moved Notepad++ & Plugin Development
    feature request
    5 Posts 4 Posters 155 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.
    • Mit JeanM
      Mit Jean
      last edited by

      I have a need to apply a find or find/Replace to Multiple Open Documents (MOD Scope). A simple new scope would do it.

      Mark/Unmark the tab with Ctrl-Click and the MOD scope gets activated

      That feature would be a fantastic time saver

      Alan KilbornA Mark OlsonM 2 Replies Last reply Reply Quote 0
      • Alan KilbornA
        Alan Kilborn @Mit Jean
        last edited by

        @Mit-Jean

        Read HERE.

        1 Reply Last reply Reply Quote 0
        • Mark OlsonM
          Mark Olson @Mit Jean
          last edited by Mark Olson

          @Mit-Jean
          If all your open documents are in a reasonably small directory tree (e.g., you don’t have one in C:\Users\yourname\Documents and one in C:\Program Files\Notepad++), you can use MS-DOS wildcard syntax to select patterns in filenames.

          For example, if I have the following files open in Notepad++

          README.md
          foo1.md
          subdir1\bfoo.axt
          subdir2\bar.bxt
          subdir2\foo2.cxt
          subdir3\foo2.md
          subdir4\foo300.dxt
          subdir4\subsubdir\foo99.fxt
          

          you could use foo*.?xt to select only the files where the filename starts with foo and the extension is one character followed by xt, which would include only

          subdir2\foo2.cxt
          subdir4\foo300.dxt
          subdir4\subsubdir\foo99.fxt
          

          This syntax is kind of frustrating and confusing in its limitations (read the documentation linked above very carefully to understand them), and while I like Notepad++ for find/replace operations in a single file, I will almost always use VSCode for find/replace operations in numerous files because it is much more performant and makes it a lot easier to include/exclude certain types of files.

          1 Reply Last reply Reply Quote 2
          • Mit JeanM
            Mit Jean
            last edited by

            My need is to apply s/rep is on currently open, possibly including not having been saved yet.

            PeterJonesP 1 Reply Last reply Reply Quote 0
            • PeterJonesP
              PeterJones @Mit Jean
              last edited by

              @Mit-Jean ,

              Notepad++ has a plethora of ways to decide which file(s) should undergo search/replace. I am not convinced it needs another.

              • One document: Search > Replace > Replace All = does replacement whether there’s a saved file or not
              • All open documents: Search > Replace > Replace All in All Opened Documents = does replacement whether there’s a saved file or not
              • Across multiple files: Search > Find in Files > Replace in Files = does replacements only in files saved to the filesystem
              • Across a specific set of files in a “Project”: View > Project Panels > Project Panel N, then in the Project Panel, Right Click on the workspace > Find in Projects (or Search > Replace, pick the Find in Projects tab) and then run Replace in Projects

              My original thought was that, instead of somehow “marking” a file for “MOD scope”, you would just add your file to the project, and use Find in Projects. But since you want to include documents that haven’t been saved to a file yet, that won’t work (because Projects require that there’s an underlying file for everything added to the Project). However, I might give the advice that it would improve your workflow (and reduce the chances of losing data) if you were able to update your workflow to always save a file to the filesystem before doing any search/replace in it (especially as a multi-file S/R, as that’s a situation where you might not notice right away that your S/R didn’t work quite as expected, and you might move beyond the undo-history before you discover your mistake). (My personal opinion is that anyone who tries to do any more editing than Create File then Save, or maybe Create File then paste boilerplate then save, is just begging their computer to lose data for them: computers crash, and applications cannot perfectly/flawlessly prevent loss of data when they do; having unsaved data is foolish, IMO. For the ephemeral stuff, I have a “scratchpad” document always open, and I make liberal use of the AutoSave plugin, as described in this FAQ. My only exception to this rule is that I often create an empty unsaved tab to paste in data from a post in this Community, verify my suggestion works, and then delete it, all with it never being saved to disk; but that’s because I know that there is a 0% chance that I would care that the data were lost if my computer crashed while I was in the middle of it, because it’s data copy/pasted from the forum.) But enough of my preaching.

              If you were to make an official feature request – like @Alan-Kilborn hinted with his link – then I would say don’t word it as you currently do: Notepad++ already has a way to apply a specific color to a document’s tab (right click on the tab, Apply Color to Tab > Apply Color N), so instead of creating yet another way of marking the file for your “MOD scope”, what I would suggest is asking for “Replace in All Tabs of Color N” where “N” is 1…5 for the five possible colors; this would make the interface very similar to the Find in Projects dialog, where you can select one of the three project panels. That way, instead of having some new concept of “MOD scope”, it would be making use of a way that Notepad++ already provides to indicate similar tabs – it would actually give you five independent “MOD scopes” simultaneously, without introducting another new concept to the N++ interface.

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