Community
    • Login

    Notepad++ lags when text files are on FTP

    Scheduled Pinned Locked Moved General Discussion
    11 Posts 4 Posters 190 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.
    • Alexander AnisimovA
      Alexander Anisimov
      last edited by

      I’m editing text files stored on an FTP server using Notepad++. The problem is Notepad++ “pings” the server every time the window regains focus, causing momentary stutters.

      Is there a way to configure Notepad++ to only sync with the FTP server when I save a file (Ctrl+S)? I want to avoid the constant background syncing and only upload changes on demand, in other words.

      May be there is a settings that when files are in Notepad++ and in use, it could create separate local temp files for those, or something like that.

      PeterJonesP CoisesC 2 Replies Last reply Reply Quote 0
      • PeterJonesP
        PeterJones @Alexander Anisimov
        last edited by PeterJones

        [[update: my answer assumes the NppFTP plugin is being used; if it’s a different circumstance, like @Coises describes below, then my answer won’t be helpful.]]

        @Alexander-Anisimov said in Notepad++ lags when text files are on FTP:

        I’m editing text files stored on an FTP server using Notepad++. The problem is Notepad++ “pings” the server every time the window regains focus, causing momentary stutters.

        Technically, it’s the NppFTP plugin, not Notepad++ itself, that is doing the pinging.

        Is there a way to configure Notepad++ to only sync with the FTP server when I save a file (Ctrl+S)? I want to avoid the constant background syncing and only upload changes on demand, in other words.

        Hmm… I cannot actually replicate your problem with constant “pinging” – whether by “window regains focus” you mean the main N++ application window regains focus, or the NppFTP tree-view or queue or message/output window. I am not seeing any unexpected traffic anywhere except when I intentionally open or save.

        May be there is a settings that when files are in Notepad++ and in use, it could create separate local temp files for those, or something like that.

        It’s up to the NppFTP plugin, not Notepad++ itself. And NppFTP plugin does use local “temp files” (what it calls its “cache”) – and in fact, you can edit the local cache file even when NppFTP isn’t connected, and when you hit save, it will re-connect so that it uploads the file. I cannot find any “extra”/unexpected traffic (“pings” or similar) caused by that plugin. (In fact, one of the longest-lived complaints about the NppFTP plugin is that it doesn’t have a keepalive function, unlike many FTP programs like FileZilla, so users are losing their connection, and it has to reconnect in order to save. Yours is rather the opposite complaint, since they are begging for pings to be added to the plugin.)

        If you can come up with an exact set of circumstances, and the exact way you can tell that the plugin “pings” the server (other than a “stutter”, which might be hard for someone to reproduce), then if another user can reproduce the same circumstances, it might be worth filing a bug report with the plugin – but again, there is nothing that the core Notepad++ app can do about it, and right now, I cannot replicate your problem with the plugin.

        Alexander AnisimovA 1 Reply Last reply Reply Quote 1
        • CoisesC
          Coises @Alexander Anisimov
          last edited by

          @Alexander-Anisimov said in Notepad++ lags when text files are on FTP:

          I’m editing text files stored on an FTP server using Notepad++.

          How are you accessing the FTP server? There is a Notepad++ plugin that does that, but you might mean that you are using some other program, like MountainDuck, to make the FTP server’s content available on your computer.

          Either way, best to click the question mark at the right end of the menu bar, select Debug Info…, then click Copy debug info to clipboard and paste the result into a reply here, so we know details like what version and plugins you are using.

          The problem is Notepad++ “pings” the server every time the window regains focus, causing momentary stutters.

          I don’t know about this, but I wonder if Settings | Preferences… | MISC. | File Status Auto Detection might affect this. Looking at the code, I wasn’t able to work out for certain how Notepad++ detects changes, but I’m thinking whatever it does might cause whatever software mirrors the server to a local cache to check the server to see if anything changed. See if changing that setting to Disabled makes any difference.

          Alexander AnisimovA 1 Reply Last reply Reply Quote 2
          • Alexander AnisimovA
            Alexander Anisimov @PeterJones
            last edited by

            @PeterJones said in Notepad++ lags when text files are on FTP:

            I cannot actually replicate your problem with constant “pinging” – whether by “window regains focus” you mean the main N++ application window regains focus, or the NppFTP tree-view or queue or message/output window. I am not seeing any unexpected traffic anywhere except when I intentionally open or save.

            Well, pardon for ambiguity, what I mean by “regains focus” is whenever you bring a Notepad++ windows to the front. Where you have your list with your text files. And then when you select a text file in your files list - it stutters cause it let’s call it “polls” the ftp location apparently.

            1 Reply Last reply Reply Quote 0
            • Alexander AnisimovA
              Alexander Anisimov @Coises
              last edited by

              @Coises said in Notepad++ lags when text files are on FTP:

              How are you accessing the FTP server?

              I merely connect my FTP server as a Network Drive in Windows and Notepad++ access those files the same way it accesses any files on any other drive.

              I do need to mention that my FTP is webdav based

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

                @Alexander-Anisimov said in Notepad++ lags when text files are on FTP:

                @Coises said in Notepad++ lags when text files are on FTP:

                How are you accessing the FTP server?
                I merely connect my FTP server as a Network Drive in Windows …

                “merely” is rather selling yourself short. Most people would not know how to do that (including me). So I wouldn’t call that a “merely” :-)

                I do need to mention that my FTP is webdav based

                Hence my confusion: when someone says “FTP server” to me, I conclude that they are accessing using an FTP client (either standalone, like FileZilla, or integrated, like the NppFTP plugin). I would guess that something accessed as a mounted drive through the WebDAV protocol would be referred to as a “WebDAV server” rather than an “FTP server” – but I don’t know the common nomenclature of WebDAV, and maybe its terminology still calls it an “FTP Server” even when you access it via WebDAV (if so, I personally don’t like that nomenclature decision on their part).

                Notepad++ access those files the same way it accesses any files on any other drive

                Right. And Notepad++ doesn’t keep a “local cache” of any other file on any other drive, and Notepad++ would have no way of knowing that there is something different about this file that makes it different from any file on a local drive.

                So based on this information, and what I now understand of the situation, I believe I can explain what you are seeing as follows: When the Notepad++ app gains focus, for the active file, it asks the OS for an updated copy of the timestamp, so that Notepad++ can see if the file has changed on disk recently; the OS then determines that the file is not local and the OS polls the WebDAV server to get the timestamp information – so it’s the Windows operating system, not Notepad++, that is polling the WebDAV server, and creating the pause. The same would happen with any app, not just Notepad++, asking the OS for an update on the status of the file.

                That said, Notepad++ checking for updates behind-the-scenes is a feature of Notepad++, and one that can be influenced by settings. I am guessing that if you look at Settings > Preferences > MISC in the File Status Auto-Detection section, you will see Enable for current file or Enable for all open files. If you don’t want Notepad++ to check to see if the active file (or all files) have been changed outside of Notepad++ (which is why it’s asking the OS for the timestamp), then change that selector to Disable instead – I am guessing that setting it to disabled will get rid of your “stutter”, but you will need to try it for yourself to be sure.

                Of course, if that works and you disable that status-detection, and someone else changes the file on the FTP/WebDAV server while you are looking at or editing the file, then Notepad++ will not see that change; thus, if you save any changes in Notepad++, it will overwrite whatever’s on the server. So the choice is up to you – and you have to weigh the pros and cons of automatically checking the status to check to see if someone else has changed the file vs the stutter that you see because it’s got to poll over the WebDAV interface: if there is no one else using that FTP/WebDAV server, then it’s probably safe to disable that option in Notepad++; otherwise, it’s up to you to decide which is better.

                Alexander AnisimovA 2 Replies Last reply Reply Quote 2
                • Alexander AnisimovA
                  Alexander Anisimov @PeterJones
                  last edited by Alexander Anisimov

                  @PeterJones said in Notepad++ lags when text files are on FTP:

                  I would guess that something accessed as a mounted drive through the WebDAV protocol would be referred to as a “WebDAV server” rather than an “FTP server” – but I don’t know the common nomenclature of WebDAV, and maybe its terminology still calls it an “FTP Server” even when you access it via WebDAV

                  You may be right. In my understanding, WebDAV is another way of connecting protocol but still is FTP, although different.
                  May be I am wrong.

                  The main idea is that whenever you add a mounted drive via WebDAV, and then access text files there from Notepad++, Notepad++ lags every now and then, it has to do with the way it’s accessed/polled.

                  mkupperM 1 Reply Last reply Reply Quote 0
                  • Alexander AnisimovA
                    Alexander Anisimov @PeterJones
                    last edited by Alexander Anisimov

                    @PeterJones said in Notepad++ lags when text files are on FTP:

                    I believe I can explain what you are seeing as follows: When the Notepad++ app gains focus, for the active file, it asks the OS for an updated copy of the timestamp, so that Notepad++ can see if the file has changed on disk recently; the OS then determines that the file is not local and the OS polls the WebDAV server to get the timestamp information – so it’s the Windows operating system, not Notepad++, that is polling the WebDAV server, and creating the pause.

                    Yes, that’s about right. But to be perfectly clear - that happens less frequently than when you Ctrl+S save a file that is in your Notepad++ list, that’s / are stored on that mounted disk via WebDAV - that’s when you definitely get a momentarily lag.

                    I’ve tested what you’ve proposed - still, when you actually save the file - it makes entire Notepad++ freeze, which may seem as a mild nuissance at first, but over time in your day-to-day usage - it becomes annoying.

                    CoisesC PeterJonesP 2 Replies Last reply Reply Quote 0
                    • CoisesC
                      Coises @Alexander Anisimov
                      last edited by

                      @Alexander-Anisimov said in Notepad++ lags when text files are on FTP:

                      Yes, that’s about right. But to be perfectly clear - that happens less frequently than when you Ctrl+S save a file that is in your Notepad++ list, that’s / are stored on that mounted disk via WebDAV - that’s when you definitely get a momentarily lag.

                      I’ve tested what you’ve proposed - still, when you actually save the file - it makes entire Notepad++ freeze, which may seem as a mild nuissance at first, but over time in your day-to-day usage - it becomes annoying.

                      If I’m following what you wrote correctly, disabling file status auto-detection has worked to solve the problem described in your original post; but a different, similar behavior, locking up for a long time when you save a file, is still present.

                      I did some searching, but I wasn’t able to determine whether Windows uses a “write-behind cache” (that might not be exactly the correct term in this use) for WebDAV. If (as I’m guessing) it does not, then Windows is not telling Notepad++ that it can proceed until the file has been completely uploaded to the server.

                      Notepad++ can’t work around that.

                      There are other ways, using third-party software, to mount a WebDAV location as a drive; I believe some of those implement write-behind caching. The inevitable cost of this is that when Notepad++ says the file has been saved, it would only mean it has been saved to the local cache. If uploading fails, you would either get that message later, from the application that does the mounting, or you wouldn’t get it at all (it would just be in an error log somewhere).

                      This article might give you some ideas:

                      Performance Testing WebDAV Clients

                      We probably cannot help you any further here.

                      1 Reply Last reply Reply Quote 1
                      • PeterJonesP
                        PeterJones @Alexander Anisimov
                        last edited by

                        @Alexander-Anisimov said in Notepad++ lags when text files are on FTP:

                        still, when you actually save the file - it makes entire Notepad++ freeze

                        The same would happen with any text editor, not just Notepad++.

                        As @Coises explains, there is nothing Notepad++ can do, because it’s in the OS/filesystem/mounting/network stack, which Notepad++ has no control over. Sorry.

                        1 Reply Last reply Reply Quote 1
                        • mkupperM
                          mkupper @Alexander Anisimov
                          last edited by

                          @Alexander-Anisimov said in Notepad++ lags when text files are on FTP:

                          You may be right. In my understanding, WebDAV is another way of connecting protocol but still is FTP, although different.
                          May be I am wrong.

                          You are wrong. :-)

                          WebDAV is a protocol that is similar to HTTP that web browsers use with web servers. As WebDAV looks like HTTP on the network it works with NAT, firewalls, web proxies, etc. Accessing a WebDAV server is just like accessing a web server. Many web browsers have built-in support for WebDAV.

                          That said, if there are bandwidth or latency issues accessing a particular WebDAV server then all applications, including Notepad++ will be impacted.

                          WebDAV itself is not slow or laggy.

                          If I was stuck with needing to edit files that are on a slow or laggy server then I probably would create script that first copies the file to the local hard drive, runs Notepad++ on the file, and then keeps an eye on both the local and remote copies of the file. If the local copy changes then I push it out to the remote server. If it changes on the remote side then pop-up a warning. A tricky aspect is that Notepad++ allows people to exit Notepad++ and then resume editing. Thus I can’t depend on Notepad++.exe going away as a signal that I no longer need to monitor and synchronize that file but also need to watch Notepad++'s session.xml file.

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