Community
    • Login

    How to disable FindHistory and FileEditViewHistory? auto-clear at exit?

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    15 Posts 5 Posters 453 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.
    • Claudia SvensonC
      Claudia Svenson
      last edited by

      As far as I know out NP++ does NOT provide an option to disable FindHistroy and FileEditViewHistory.

      The only way is to manually (!) edit config.xml and delete corresponding lines.

      This is surprising and disappointing.
      I would call it a privacy issue.

      Are there any reasons to not let users disable recent file/search pattern lists?
      Or at least to let them reduce it to only 1 item via GUI Settings?

      Or clear this items automatically at exit?

      Alan KilbornA mkupperM 2 Replies Last reply Reply Quote 0
      • Alan KilbornA
        Alan Kilborn @Claudia Svenson
        last edited by

        The real answer is to lock your PC when you leave it?

        1 Reply Last reply Reply Quote 2
        • mathlete2M
          mathlete2
          last edited by mathlete2

          @Claudia-Svenson in Settings > Preferences, there is a Recent Files History section that allows you to customize the number of files in your history, and it looks like 0 is a valid option:

          335d8caf-f9e6-4da9-81ad-740e38b0c003-image.png

          1 Reply Last reply Reply Quote 3
          • mathlete2M
            mathlete2
            last edited by

            @Claudia-Svenson as for the Find history: I don’t see any settings in the Preferences window for this, but if you look in your config.xml file, you will see a FindHistory tag with several nbMaxFindHistory... entries. On my setup, they are all set to 10, and I have 10 Find/Replace entries in that section. So, in addition to deleting the Find/Replace entries, changing the nbMaxFindHistory.. values to 0 might prevent NP++ from keeping a history going forward.

            1 Reply Last reply Reply Quote 3
            • mkupperM
              mkupper @Claudia Svenson
              last edited by mkupper

              (edit as there was a cross post)

              @Claudia-Svenson, @mathlete2 has answered you for both the file history part and then the search history part. I had posted what’s below not realizing that mathlete2 was also answering the second part. Hopefully between what the two of us wrote you will know your to fix your Notepad++.

              While Notepad++ is running the history for search/replace seems to be unlimited. However, Notepad++ saves the last 10 things searched for when it exits along with what was searched for.

              You can configure how many search terms get saved by editing your config.xml file.

              1. Exit from Notepad++
              2. Using Microsoft Notepad or an editor other than Notepad++ edit Notepad++'s config.xml file.
              3. Near the very top of the config.xml file you will see a line with:
              <FindHistory nbMaxFindHistoryPath="10" nbMaxFindHistoryFilter="10" nbMaxFindHistoryFind="10" nbMaxFindHistoryReplace="10" ...>
              

              Change the number 10 to 0 (zero). You will need to change this in four spots on that line.

              <FindHistory nbMaxFindHistoryPath="0" nbMaxFindHistoryFilter="0" nbMaxFindHistoryFind="0" nbMaxFindHistoryReplace="0" ...>
              
              1. Save the config.xml file and restart Notepad++.

              Notepad++ will now be in a mode where the search history still has an unlimited length while Notepad++ is running but when you exit Notepad++ then the search history is not saved.

              Notepad++ loads the config.xml file when it’s started and writes it back out when you exit Notepad++. That’s why in step 2 above you needed to use an editor other than Notepad++ to make the changes to config.xml.

              Your config.xml file is normally at %AppData%\Notepad++\config.xml. If it is not their then post your Notepad++ ? / debug info menu results here and someone will help you find the config.xml file.

              mathlete2M 1 Reply Last reply Reply Quote 5
              • mathlete2M
                mathlete2 @mkupper
                last edited by

                @mkupper said in How to disable FindHistory and FileEditViewHistory? auto-clear at exit?:

                Notepad++ loads the config.xml file when it’s started and writes it back out when you exit Notepad++. That’s why in step 2 above you needed to use an editor other than Notepad++ to make the changes to config.xml.

                The Configuration Files documentation also suggests using a portable copy of NP++ to do the editing, but another way to work around the overwrites is to:

                1. Copy config.xml to another directory.
                2. Edit the copy with your usual NP++ installation.
                3. Close the session.
                4. Rename the original file to back it up.
                5. Copy over the edited file.
                1 Reply Last reply Reply Quote 4
                • Alan KilbornA
                  Alan Kilborn
                  last edited by

                  While the proposed solutions by @mathlete2 and @mkupper probably work, they seem like they would be rather limiting to the user. I mean, well, what happens when the user wants to use the history to e.g. reopen a closed file…or when the user wants to recall some complicated regex search that they conducted yesterday – this data obviously won’t be there.

                  It’s one thing to answer a question, but it might be a more helpful thing to direct a user to a better place overall. But I suppose we can’t do this because @Claudia-Svenson didn’t elaborate on the situation in place where others could possibly somehow see this data.

                  There are more privacy concerns with Notepad++ when used in situations such as @Claudia-Svenson 's. An example is “unsaved” text data being saved in the “Backup” folder – gasp, anyone with access to the PC could see this.

                  It’s all a bit irrelevant, though, as on an “unsecured” PC, a rogue user sitting down at someone’s unlocked PC could see all. I’m not saying this is the @Claudia-Svenson situation, but just what is that situation?

                  1 Reply Last reply Reply Quote 3
                  • MarkusBodenseeM
                    MarkusBodensee
                    last edited by MarkusBodensee

                    There is no reason to question the enquiry/use case from @Claudia-Svenson . Privacy is important and a good reason for the question. Even more, it is good and valid that people are thinking about privacy and asking such questions.

                    In general it is a similar reason why browsers have a private mode.

                    I think it is clear, that both, privacy and working without limitation, is not possible at the same time, but removing all kind of history is exactly what is asked for in this topic.

                    As an example, consider the following use case. Multiple users/workers have access to same work station at a production line. Someone needs to reconfigure a machine with some confidential data from a customer. Data maybe from an external storage, so nobody else has access without rights, and it gets unplugged afterwards. Open it with Notepad++, does some adaption/formatting/searching to the confidential data. Configure machine. Clear history after finishing work.

                    I didn’t know that it is even possible to disable find history, thank you @mathlete2 and @mkupper for pointing this out.

                    Thank you @Alan-Kilborn for addressing the backup topic here, too, and the possibility to disable this feature. This is definitly something @Claudia-Svenson should also have a look at.

                    Alan KilbornA 1 Reply Last reply Reply Quote 3
                    • Alan KilbornA
                      Alan Kilborn @MarkusBodensee
                      last edited by Alan Kilborn

                      @MarkusBodensee said:

                      There is no reason to question the enquiry/use case

                      I mildly disagree, for reasons already stated… but mainly the reason is “to give better help to a questioning user”. But, in the spirit of “just answer the question posed”, then OK, the earlier answers (besides mine!) were very reasonable.

                      use case: Multiple users/workers have access to same work station at a production line. Someone needs to reconfigure a machine with some confidential data from a customer

                      Hopefully this is something I.T. has considered. (Of course, @Claudia-Svenson could be I.T., who knows…)

                      Data maybe from an external storage, so nobody else has access without rights, and it gets unplugged afterwards.

                      In this scenario, I’d remove Notepad++ from the machine, and put portable Notepad++ on the “external storage” along with the data.


                      But, I normally resist speculation, i.e., using a crystal ball on a question in order to respond, so I’ve violated my own internal guideline on this one.

                      Claudia SvensonC 1 Reply Last reply Reply Quote 1
                      • Claudia SvensonC
                        Claudia Svenson @Alan Kilborn
                        last edited by Claudia Svenson

                        Ok thank you.

                        Your suggestions seem partially to work.

                        The “Recent File History” in configuration refers to only the <FileEditViewHistory>. I miss a corresponding option for <FindHistory>.

                        Its strange that users have to fiddle around in config.xml for an advanced editor like NP++

                        Furthermore it the checkbox “Don’t check at launch time” is surprising . I cannot imagine a scenario where NP++ should NOT check this option at launch time. So its always checked.
                        Or does it mean “only check at startup”?
                        very confusing

                        Alan KilbornA mathlete2M mkupperM MarkusBodenseeM 4 Replies Last reply Reply Quote 0
                        • Alan KilbornA
                          Alan Kilborn @Claudia Svenson
                          last edited by

                          @Claudia-Svenson said:

                          Furthermore it the checkbox “Don’t check at launch time” is surprising . I cannot imagine a scenario where NP++ should NOT check this option at launch time. So its always checked.
                          Or does it mean “only check at startup”?
                          very confusing

                          https://npp-user-manual.org/docs/preferences/#recent-files-history

                          1 Reply Last reply Reply Quote 1
                          • mathlete2M
                            mathlete2 @Claudia Svenson
                            last edited by

                            @Claudia-Svenson said in How to disable FindHistory and FileEditViewHistory? auto-clear at exit?:

                            I miss a corresponding option for <FindHistory>.

                            Its strange that users have to fiddle around in config.xml for an advanced editor like NP++

                            TBH, I was a bit surprised that there wasn’t a GUI-based method of customizing/managing the Find/Replace history, but I think it’s great that things like this can be managed via the configuration files; not all software gives users this level of control/flexibility.

                            1 Reply Last reply Reply Quote 1
                            • mkupperM
                              mkupper @Claudia Svenson
                              last edited by

                              @Claudia-Svenson said in How to disable FindHistory and FileEditViewHistory? auto-clear at exit?:

                              The “Recent File History” in configuration refers to only the <FileEditViewHistory>. I miss a corresponding option for <FindHistory>.

                              That reminds me that there is a version of “find” that leaves a minimal history and another that leaves no history.

                              If you are interested in a search that leaves “no history” then see Find (Volatile) Next (Ctrl+Alt+F3) / Find (Volatile) Previous (Ctrl+Alt+Shift+F3) in the manual and the manual section on Comparison between “Select and Find Next” and “Find (Volatile) Next”

                              It turns out the non-volatile Ctrl+F3 or Ctrl+Shift+F3 searches leave a minimal history. The manual says they are added to the history but that’s not quite true meaning this may be a Notepad++ bug.

                              If you have some text selected then using the keyboard you can do Ctrl+F3 or Ctrl+Shift+F3. Ctrl+F3 finds in the forward direction and Ctrl+Shift+F3 finds in the backwards or reverse direction.

                              If you use either of those then you will discover it’s in the topmost part of the find history but it gets overwritten should you do another Ctrl+F3 style search or a normal search. It also does not get saved to Config.xml when Notepad++ exits, even if you have the <FindHistory> values set to something other than zero.

                              Ctrl+F3 are Ctrl+Shift+F3 also available via the menus under Search / Select and Find Next and Search / Select and Find Previous. They are always a “normal mode” search meaning you would not be able to use the \ style escape codes available in extended searches nor the various features of regular expression searches.

                              I have always relied on them as a “quick search” and depend on their normal mode operation as they are a quick way for me to search for regular expressions or things with \ as as Windows file paths. I knew they did not get added to the find history and had assumed that was a feature but now see that [the manual](https://npp-user-manual.org/docs/searching/#searching] says “The searched word or selection is stored in the find history.” That’s not quite true. They show up in the history but are not “added” to the history.

                              1 Reply Last reply Reply Quote 0
                              • MarkusBodenseeM
                                MarkusBodensee @Claudia Svenson
                                last edited by MarkusBodensee

                                @Claudia-Svenson said in How to disable FindHistory and FileEditViewHistory? auto-clear at exit?:

                                The “Recent File History” in configuration refers to only the <FileEditViewHistory>. I miss a corresponding option for <FindHistory>.

                                Its strange that users have to fiddle around in config.xml for an advanced editor like NP++

                                Ah, one more option which I think was not mentioned here, but which I use very often (very useful to remove mistyped entries from search/replace history). Use the Delete Key (Del) on your keyboard to remove entries from the search/replace list. Highlight the entry in the dropdown and press Del to delete.

                                Alan KilbornA 1 Reply Last reply Reply Quote 4
                                • Alan KilbornA
                                  Alan Kilborn @MarkusBodensee
                                  last edited by

                                  @MarkusBodensee said:

                                  Highlight the entry in the dropdown and press Del to delete.

                                  To extend this idea, drop down the combobox, then press and hold Del (aka Delete) to remove all entries (ask the key repeats).

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