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.
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.
-
[[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-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.
-
@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.
-
@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
-
@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
orEnable 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 toDisable
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.