Community
    • Login

    Notepad++ File Status Auto-Detection not working

    Scheduled Pinned Locked Moved General Discussion
    file statusauto-detectionnot working
    57 Posts 10 Posters 43.7k 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.
    • Vitaliy DovganV
      Vitaliy Dovgan
      last edited by

      As far as I understand, an honour to implement the proposed change is mine :) As Notepad++ is the base for all its plugins, I consider such task as quite important. I don’t promise I do it quickly, but I already have an idea what exactly to do. Since _wstat is already called through a macro, the most straightforward change will be to call own function instead of _wstat via the very same macro, providing own structure returned by the function, and the structure will be filled by the WinAPI functions. So the code will remain similar at the surface, but will not rely on _wstat anymore.

      1 Reply Last reply Reply Quote 1
      • Vitaliy DovganV
        Vitaliy Dovgan
        last edited by

        OK, guys, I want to make everything in the proper way :) Do you usually create a new git branch to use it for the pull request? Or just directly modify the “master” branch? And is there any possible hints/problems regarding authorization (such as special write rights, SSH, etc.)?

        1 Reply Last reply Reply Quote 0
        • chcgC
          chcg
          last edited by

          See https://github.com/notepad-plus-plus/notepad-plus-plus/pulls e.g.
          https://github.com/notepad-plus-plus/notepad-plus-plus/pull/4172 made from branch cmeriaux:fix_shortcut_validity. So branching your forked master is the better way, so you could easily pull upstream master again for future work. See also https://github.com/notepad-plus-plus/notepad-plus-plus/blob/master/CONTRIBUTING.md. There shouldn’t be problems regarding auth against your github fork.

          1 Reply Last reply Reply Quote 1
          • chcgC
            chcg
            last edited by

            Maybe check this one https://gist.github.com/Chaser324/ce0505fbed06b947d962 regarding git usage with github.

            1 Reply Last reply Reply Quote 2
            • Vitaliy DovganV
              Vitaliy Dovgan
              last edited by

              Probably I’m doing something wrong, but here is what I’m getting currently:

              git.exe push --progress "origin" feature/file-status-detection-winxp
              
              remote: Permission to notepad-plus-plus/notepad-plus-plus.git denied to d0vgan.
              fatal: unable to access 'https://github.com/notepad-plus-plus/notepad-plus-plus.git/': The requested URL returned error: 403
              
              
              1 Reply Last reply Reply Quote 0
              • chcgC
                chcg
                last edited by

                You can’t push to the repo of donho at https://github.com/notepad-plus-plus/notepad-plus-plus. Do you have a fork of it? Something like https://github.com/chcg/notepad-plus-plus?

                1 Reply Last reply Reply Quote 0
                • Vitaliy DovganV
                  Vitaliy Dovgan
                  last edited by

                  That must be it! I did not fork it indeed, just created a branch directly from the https://github.com/notepad-plus-plus/notepad-plus-plus. Will do the fork, thanks.

                  1 Reply Last reply Reply Quote 0
                  • Vitaliy DovganV
                    Vitaliy Dovgan
                    last edited by

                    You know, I realized I absolutely hate the f*ckin’ git, just completely and absolutely.
                    I’ve created https://github.com/d0vgan/notepad-plus-plus/tree/feature/file-status-detection-winxp and I followed hell of instructions to synchronize it with the main (non-forked) repository. Currently I’m having:

                    git remote -v
                    origin  https://github.com/d0vgan/notepad-plus-plus.git (fetch)
                    origin  https://github.com/d0vgan/notepad-plus-plus.git (push)
                    upstream        https://github.com/notepad-plus-plus/notepad-plus-plus.git (fetch)
                    upstream        https://github.com/notepad-plus-plus/notepad-plus-plus.git (push)
                    

                    And I already tried commands such as (I’m listing them here one by one, but actually I tried them in different order according to what I found in internet):

                    git fetch upstream
                    git merge upstream/master
                    git rebase upstream/master
                    git rebase master
                    

                    but still an attempt to create a pull request shows much more changes than I actually made.
                    I just don’t have any idea what else I need to do to overfight this git madness. It just drives me out of my wits.

                    1 Reply Last reply Reply Quote 2
                    • Vitaliy DovganV
                      Vitaliy Dovgan
                      last edited by Vitaliy Dovgan

                      OK, I’ve created https://github.com/notepad-plus-plus/notepad-plus-plus/pull/4226
                      I have no idea idea why git shows changes in the functions isCertificateValidated and isAssoCommandExisting - I did not touch them at all! If I knew how to get rid of those “changes”, I would do it already.

                      1 Reply Last reply Reply Quote 0
                      • ggo98G
                        ggo98
                        last edited by

                        Still have the same issue on some machines (file change not detected).
                        In my case, it’s on Win 8.1 with NPP 7.9.5 (same with 7.9.1 and previous versions)…
                        Any solution since 2018 please?
                        Thanks.

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

                          @ggo98 ,

                          If you have an exact sequence of events that doesn’t work as expected, which others can replicate, then share it here, and we can try to confirm; if we agree that there’s a problem, then you can follow the FAQ to make a bug report. But all you have is a vague assertion that something “doesn’t work”. I’ve never yet seen a version of Notepad++ that doesn’t report to me when an external process has changed my file in my workflows. So, with the lack of detail you’ve provided, the best I can say is “it works for me”.

                          For example, a repeatable sequence:

                          1. create a file named opened.txt in Notepad++, with the text This is opened., and save into a known folder
                          2. right click on the tab bar, and select Open Containing Folder in cmd (or File > Open Containing Folder > cmd)
                          3. from the cmd prompt, echo appended >> opened.txt
                          4. click on Notepad++: it will say, cb6fd39b-5e06-40de-b4a0-6f7387063df5-image.png
                          5. when I say Yes, the file reloads and now shows This is opened.appended .
                            That says Notepad++ noticed the change in the file.
                          6. Turn on Monitoring mode (either the eyeball on the toolbar, or View > Monitoring (tail -f)
                          7. Do a few instances of time /t >> opened.txt from the cmd window
                          8. the Notepad++ editor shows the updated file with a few timestamps

                          ?-menu > Debug Info

                          Notepad++ v7.9.5   (64-bit)
                          Build time : Mar 21 2021 - 02:13:17
                          Path : C:\usr\local\apps\npp\npp.7.9.5.portable.x64\notepad++.exe
                          Admin mode : OFF
                          Local Conf mode : ON
                          OS Name : Windows 10 Home (64-bit) 
                          OS Version : 2004
                          OS Build : 19041.867
                          Current ANSI codepage : 1252
                          Plugins : mimeTools.dll NppConverter.dll NppExport.dll 
                          

                          The settings in Settings > Preferences > MISC > File Status Auto-detection may also influence your results. During my above experiments, mine were set to e3ce0467-32c0-4352-9978-3e8e327a4d85-image.png

                          So again, I say, “it works for me”.

                          David Brigden52D 1 Reply Last reply Reply Quote 1
                          • David Brigden52D
                            David Brigden52 @PeterJones
                            last edited by

                            Everyone,

                            I backed into this issue the other day and and can replicate. It’s related to the NotePad++ split view. I see this in 7.9.5 and saw in 7.9.3 though I assume this is older.

                            Debug Info:
                            Notepad++ v7.9.5 (32-bit)
                            Build time : Mar 21 2021 - 02:09:07
                            Path : C:\Program Files (x86)\Notepad++\notepad++.exe
                            Admin mode : OFF
                            Local Conf mode : OFF
                            OS Name : Windows 10 Enterprise (64-bit)
                            OS Version : 2004
                            OS Build : 19041.804
                            Current ANSI codepage : 1252
                            Plugins : none

                            Here’s how I can repeat.

                            1. open/create 2 files call them view1 and view2 and save
                            2. move one to other view.
                            3. click on view1 so that N++ is focused there
                            4. open a command prompt and edit view2. (I used copy con)
                            5. click on the Notepad ++ title bar
                            6. N++ is focused on view1.
                            7. click on view2. no warning of file status change.
                            8. Click on the command window and then back to view2 and the message appears.

                            If you change step 5 to click on the edit window for view1, you don’t get the warning. If you change step 5 to click on view2, you DO get the warning. Similarly, if you are in view2 when you go to the command prompt, what happens is also changed.

                            • Click on the N++ title bar and the warning will appear.
                            • Click on view2 and the warning will appear
                            • Click on view1 and the warning will not appear
                            Michael VincentM PeterJonesP 2 Replies Last reply Reply Quote 0
                            • Michael VincentM
                              Michael Vincent @David Brigden52
                              last edited by

                              @David-Brigden52

                              Unless I’m misreading what you wrote, this sounds like expected behavior. Consider a Notepad++ session with 20 files open and I run some external program that modifies all 20 files. I don’t think I want 20 popups saying each file was modified. I think I’d rather get the prompt when I activate any single one of the files that has changed.

                              It sounds like exactly what you are describing. View2 changes and you only get the popup when you click on View2. Again, suppose I have 20 views and 19 of them are updated externally but I’m still editing the one that hasn’t changed. I don’t want to deal with 19 popups just so I can continue editing my current 1 unchanged file.

                              Cheers.

                              1 Reply Last reply Reply Quote 1
                              • PeterJonesP
                                PeterJones @David Brigden52
                                last edited by

                                @David-Brigden52 ,

                                Sorry, I cannot replicate your results. When I try the experiment, it works exactly as I would expect.

                                See this screenToGif.exe screencapture.

                                Notepad++ v7.9.5   (64-bit)
                                Build time : Mar 21 2021 - 02:13:17
                                Path : C:\usr\local\apps\notepad++\notepad++.exe
                                Admin mode : OFF
                                Local Conf mode : ON
                                OS Name : Windows 10 Enterprise (64-bit) 
                                OS Version : 1903
                                OS Build : 18362.1256
                                Current ANSI codepage : 1252
                                Plugins : ComparePlugin.dll ExtSettings.dll HexEditor.dll LuaScript.dll MarkdownViewerPlusPlus.dll mimeTools.dll NppConsole.dll NppConverter.dll NppEditorConfig.dll NppExec.dll NppExport.dll NppFTP.dll NppUISpy.dll PreviewHTML.dll PythonScript.dll QuickText.dll TagLEET.dll XMLTools.dll 
                                

                                Oh, I checked my settings, and I had:
                                72779c76-8c69-4842-9d74-7e620effa062-image.png

                                When I disable Update Silently, I get similar results, but with a popup each time:

                                …

                                And I agree with the answer that @Michael-Vincent gave while I was composing this reply: I might expect that whatever is visible would be updated immediately (or at 1 minute intervals, or some reasonable period) – which it seems to be, in my experiment, shown. I would not expect (or want) to get update messages for multiple background/non-visible files until I wanted to switch to those files.

                                But honestly, if I know I’m looking at a file that is being changed by a background process, I think I prefer the “update silently” option, so it doesn’t pester me every time.

                                David Brigden52D 1 Reply Last reply Reply Quote 0
                                • David Brigden52D
                                  David Brigden52 @PeterJones
                                  last edited by

                                  @Michael-Vincent, @PeterJones

                                  I realize I may have been a bit unclear. When I edit view2 from the command prompt then click on view1, I don’t get a prompt at that time, correct. To me, that’s working as designed. I don’t get a prompt for a modified file until I’m working on the file. BUT. When I then switch to view2, I expect at that time, I should get a prompt that view2 was edited. This isn’t happening.

                                  While I do OFTEN work with files that are edited (and even deleted) by processes outside of N++, I rarely do so in split view, so this is not critical for me. But I’m really confused by the fact that @PeterJones appears to be replicating the steps I was doing (and more) and not seeing this behavior. It irritates me.

                                  I use a dark theme rather than the default Would that make a difference?

                                  And then what I’ve seen asked by others. What tool do you use to do the screen recording? I would love to replicate and show each step to find out what I’m doing differently.

                                  PeterJonesP 1 Reply Last reply Reply Quote 1
                                  • Terry RT
                                    Terry R
                                    last edited by Terry R

                                    @David-Brigden52 said in Notepad++ File Status Auto-Detection not working:

                                    What tool do you use to do the screen recording?

                                    One used is called ScreentoGif, here.

                                    Highly configurable, and when I had a go i found it does need the settings tweaked, otherwise the results can be so-so.

                                    Terry

                                    1 Reply Last reply Reply Quote 0
                                    • PeterJonesP
                                      PeterJones @David Brigden52
                                      last edited by

                                      @David-Brigden52 said in Notepad++ File Status Auto-Detection not working:

                                      I use a dark theme rather than the default Would that make a difference?

                                      I could be wrong, but I cannot see how.

                                      not seeing this behavior. It irritates me.

                                      I can understand that.

                                      In full disclosure, I do sometimes see Notepad++ not update as quickly as I’d like – this screen capture was quite cooperative.

                                      Sometimes, I think it doesn’t notice until the system clock is about 1min beyond the timestamp of the file. (And I think I’ve even seen longer delays when the file was created on a machine whose time was off from my local machine.)

                                      I don’t know the full algorithm that Notepad++ uses, but my guess is that in the real-life circumstances, it’s a combination of Windows not having yet flushed the file to disk from the other process and Notepad++ not polling constantly (it wouldn’t want to spend all its cpu cycles on checking for changed files).

                                      In the contrived circumstances like my example derived from your instructions, I would expect pretty consistent behavior (since the individual processes of the time/copy-con commands will flush to disk when they close).

                                      If I’m ever getting impatient, I just use the File > Reload from Disk to make sure it’s up-to-date. (The funny thing is, that’s sometimes accompanied a few seconds later by “this file has been updated”, when it then updates to the state of the file that I just manually updated to).

                                      You might try experimenting with the MISC > File Status Auto-Detection settings… maybe having recently changed from one to the other enabled the algorithm to work more consistently for me, or something…

                                      Unfortunately, I am out of solid ideas, and since such problems are often the combination of many factors, it may be difficult to come up with a complete solution. But hopefully someone else has ideas for you to test.

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