OneDrive interactions with Notepad++
My company has recently mandated that we put our data in the OneDrive location that they’ve set up for us. I suppose this is an attempt to protect company data from loss in the event of a hard drive failure.
Anyway, when starting to do this, I’ve noticed that whenever I have a file open in Notepad++ that is stored on the OneDrive, if I switch away from Notepad++ while working on the file, and then switch back, I get the “This file has been modified by another program. Do you want to reload it?” prompt.
Because I’m good about saving, I have saved the document before switching away, so I feel good (I think!) about answering the prompt with either Yes or No, but…the prompt is still annoying and workflow disrupting.
I don’t want to turn off the externally-modified-reload-prompting in Notepad++, because I need that feature in other work.
I’m getting the feeling this is just a consequence of how OneDrive works, but I’m wondering if any others have experienced this; I can’t recall other postings of this nature.
Hmmm. Maybe our OneDrive’s are configured differently somehow. I have noticed that if I save my OneDrive doc in N++, and switch away, and then come back, I get the reload prompt, which I then respond to, but then if I don’t make further changes and save them, I can switch back and forth among applications (of course including N++) and I don’t get the prompt.
Something about saving the OneDrive doc triggers OneDrive to do something to make it appear to N++ that things have changed, at the following switch-away-switch-back cycle.
As a follow-up to how this turned out, it became a non-issue for me because the way our OneDrive works annoyed me so much in other ways, that I no longer directly work from it, I just use it for backup purposes. Problem (sort of) solved, for me.
I’ve got the same behaviour with my onedrive.
It looks like when I save a file in OneDrive local folder , the background service takes it to upload the file to cloud folder and then saves some bit to local file to be sure not to take this file anymore, at least until next change.
But notepad++ reads this changed bit and considers the file as changed.
steps to test:
- open/create a file in local onedrive folder, ensure the file is uploaded in cloud
- make some little change to file, save, ensure changes are uploaded in cloud, by using a browser let’s say
- go back to notepad++, the pop-up says the file is changed.
Most probable “culprit” is the status or status-icon, it changes during sync process. If I pause syncing I’ve got no fake warn, I’ve got it again when I restart syncing.
Notepad++'s reload prompt only fires based upon the file timestamp that the OS supplies to Notepad++. So any funkyness regarding onedrive is related to this, not some “local bit” or “status icon”.
My personal theory about onedrive is that there are many ways it can be configured. Depending on what configuration is set, at different times it can make Notepad++ think that the filetime has changed, thus firing the reload prompt.