File edits not changing file status
-
Hello
I’m having an issue where I can edit a text file in NP++ but the file status doesn’t change in the editor, and even if I save, my changes are lost. If I reload the file, the contents are displayed as they were before my edit. I’m using NP++ in multi instance mode if that’s of relevance…
I can consistently reproduce the behaviour.
- Create a new file, enter some text, save it. The file is correctly marked as new/modified.
- Add some more text to the file - the file is not marked as modified. I hit save and the file is not saved.
- I reload and my edits are lost.
- If I now re-edit the file, it’s marked as modified and the save works.
Is there a reason NP++ wouldn’t mark a file as edited (change the colour of the tab to red etc) even when I type new characters into it? This is happening with new files and existing ones. My only thought is that our corporate virus scanner is somehow messing with NP++ but I don’t understand why it’s not marking the file as modified when I type new characters in. I’ve disabled the file status detection and restarted np++ but that’s not helped.
Any thoughts on how I can debug this further?
-
Hmm, this is the second time I see such a complaint.
See here for details.
A new installation fixed it for the OP.
Still wondering why and how this might happen.
@David-Tyler - do you use an installed or portable version?
Which version do you use at all? (can be seen from debug-info from ? menu)
If you use an installed version, how did you install it?
Is something different on your OS compared to the standard installation? Something like language, filesystem …? -
Hi @Ekopalypse
Thank you for the link - that is indeed the behaviour I’m seeing. My version of np++ is
Notepad++ v7.8.4 (64-bit)
Build time : Jan 29 2020 - 01:31:03
Path : C:\Program Files\Notepad++\notepad++.exe
Admin mode : OFF
Local Conf mode : OFF
OS Name : Windows 10 Enterprise (64-bit)
OS Version : 1809
OS Build : 17763.1039
Plugins : ComparePlugin.dll mimeTools.dll NppConverter.dll NppExport.dll SessionMgr.dll SQLinFormNpp64.dll SurroundSelection.dll XBrackets.dllI’ve recently updated the installation but the problem is still there. I did try renaming the appdata/np++ folder and relaunching but it didn’t make a difference.
I installed using the regular installer - it’s not the portable version.
OS wise, we have our virus scanner - I do have local admin rights. I though this might be an issue with mercurial (source control) but tested the problem in folders not under source control and the problem is the same.
File system on the disk is NTFS with indexing switched on. There’s no quota management enabled and the disk is about 50% full (ever the optimist).
Language on the OS is US english with UK english as an option. Nothing else stands out as being particularly unusual about the installation.
From the link you provided, there was a suggestion to uninstall and reinstall from scratch so I might give that a go - I’ve updated several times over the last few months and the problem has persisted.
-
only other thing of note is that I’m using multi instance. I’ll try with single instance and see if it makes a difference
-
Interesting. So the behaviour does seem to be specific to the 64bit version.
I uninstalled the 64 bit version, selected not to keep custom settings and reinstalled. The behaviour persisted.
I uninstalled the 64bit version, selected not to keep custom settings and then installed the 32bit version. In the 32 bit version I can’t reproduce the issue.
Notepad++ v7.8.5 (32-bit)
Build time : Mar 4 2020 - 11:04:20
Path : C:\Program Files (x86)\Notepad++\notepad++.exe
Admin mode : OFF
Local Conf mode : OFF
OS Name : Windows 10 Enterprise (64-bit)
OS Version : 1809
OS Build : 17763.1039
Plugins : mimeTools.dll NppConverter.dll NppExport.dllI’m guessing there is more info I could provide to help with debugging further - any suggestions as to what would be good to bundle up?
-
@David-Tyler
Just to confirm, I’m working with npp x64 and multiinst mode consistently.
I haven’t had any issues but I do use Windows7 x64The part which doesn’t make sense to me is
Add some more text to the file - the file is not marked as modified
You were able to create the file with some initial text but updating it failed.
So from logical point of view it cannot be a permission issue
unless something changed it after file creation but this would not
explain why editing works again after reloading.What I would try to do in such a case is to use procmon and see
if it can reveal what happens under the hood.One other thing I found, it seems that Win10 introduced something new called Controlled folder Access.
It has been reported that this can cause the symptoms
you mentioned and it seems can be solved by following this instructions.Maybe this new feature is still buggy under some circumstances and
temporarily disabling it for testing might be a good first step as well.As you see, I’m fishing in the dark.
-
Yes I’m guessing this is a combination of windows 10 and 64bit. I’ve been using 64 bit for the last 12 months and I only noticed the issue a few months back but wasn’t able to reproduce.
You were able to create the file with some initial text but updating it failed.
So from logical point of view it cannot be a permission issue
unless something changed it after file creation but this would not
explain why editing works again after reloading.Yes, it feels like it’s more about internal state in np++ than something external. It seems like something is interfering with the file being marked as dirty. So the steps are:
- Create new file.
- Add text
- Save it
- Add more text
- Save remains disabled
- Reload - edits lost
- Reapply edits, save enabled
- Save file
I’ll have a look at procmon and come back with findings etc.
Re the controlled folder access, unfortunately I can’t do anything with that as it’s locked down as part of corporate policy etc.
Thank you for your help and suggestions.
-
Just a further update to this, it seems I was a bit quick off the mark in declaring this a 64bit issue. It’s happening with the 32bit version too. I’ll dig more with procmon
-
My copy has started doing this again too.
-
@Ekopalypse While a re-install did initially solve the problem, it’s back again for me.
It seems to only affect NEW files in my situation, not opening an existing file. So for the time being, until a fix is found, I’ll do the initial save on a new file, close the file, then re-open it. If I continue to edit after the initial save (without closing and re-opening), subsequent changes are never detected and the File/Save command is still disabled so I can’t save. So if I do continue to edit after the initial save, all of those changes are lost unless I File/Save As to save it as a new file, delete the original file, then rename the new file.
It’s definitely awkward, and has caused me quite a bit of grief and unnecessary time trying to track down and fix bugs in my code, when the problem is that my fixes for the bugs haven’t actually been committed to disk, so the updated versions of the code aren’t being run.
-
That’s a tough one if we cannot find a pattern/way to replicate this.
I’ve been working with 7.8.4 and now 7.8.5 for some time and never
experienced this situation.
The only advice I can give at the moment is to use tools like procmon
to see if it can reveal the source of the problem.I understand if one says: Neither do I have the time nor the desire to deal with tools like procmon to identify the problem.
But our issue is that we have little approach to find the reason for this problem if it does not occur in our case. -
What would I look for in procmon?
It’s difficult for me to give any more steps to replicate. It now happens every single time on my system now. I can’t get it to not misbehave.
I’m currently running version 7.8.5, 32-bit version on Windows 10 Enterprise 64-bit in an Active Directory environment (yes, I run AD at home). AMD Ryzen 9 3950X processor, 64 GB of RAM, 21 TB of storage (5 TB in SSDs, 16 TB HDDs), nVidia RTX 2080 video. The plugins I have installed are: HEX-Editor 0.9.5, JSON Viewer 1.34, Mime tools 2.5, Npp Converter 4.2.1, Npp Export 0.2.9, NppFavorites 1.0.0.1, Session Manager 1.4.3. At any given time I usually have about a dozen PHP files open.
-
for example I created filters for process notepad++exe and file cydialog.pyx
and made sure the file activities are selected (red arrow).
You will get results likeThe most interesting here are the write and close operations.
If you scroll more to the right you will see additional useful information
-
There isn’t much there. But the problem did occur in this scenario.
https://www.djprod.biz/NPPLogfile2.CSV
I created a new file, added some code, saved it as test.php, made some more changes, and the File / Save command was disabled.
-
hmm, there are only 3 rows in your trace which do have test.php in it
"10:26:42.6211877 AM","notepad++.exe","34880","CreateFile","C:\redacted\test.php","SUCCESS","Desired Access: Read Attributes, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened" "10:26:42.6212222 AM","notepad++.exe","34880","QueryBasicInformationFile","C:\redacted\test.php","SUCCESS","CreationTime: 3/24/2020 10:26:42 AM, LastAccessTime: 3/24/2020 10:26:42 AM, LastWriteTime: 3/24/2020 10:26:42 AM, ChangeTime: 3/24/2020 10:26:42 AM, FileAttributes: A" "10:26:42.6212463 AM","notepad++.exe","34880","CloseFile","C:\redacted\test.php","SUCCESS",""
Just a CreateFile with READ access a QueryBasicInformationFile and
a CloseFile. No WriteFileAnother strange thing, those APIs are normally not reported but
IRP_MJ_CREATE, IRP_MJ_QUERY_INFORMATION … are.Can you post your debug-info from notepad++ ? menu?
How long is the path of
"C:\redacted\test.php"
in real?
Do you hit some ancient windows limits like 128 or 260 ? -
I only uploaded the portions of the log that seemed relevant. I probably trimmed out too much. I’ve re-uploaded using the same URL as before without removing anything.
The real path of the files is 60 characters or fewer. All English alphanumeric characters, no spaces. The portion I removed was about 20 characters.
Notepad++ v7.8.5 (32-bit)
Build time : Mar 4 2020 - 11:04:20
Path : C:\Program Files (x86)\Notepad++\notepad++.exe
Admin mode : OFF
Local Conf mode : OFF
OS Name : Windows 10 Enterprise (64-bit)
OS Version : 1909
OS Build : 18363.720
Plugins : HexEditor.dll mimeTools.dll NppConverter.dll NppExport.dll NppFavorites.dll NPPJSONViewer.dll SessionMgr.dll -
first, I know why your report used createfile etc… while I’m used to see
IRP_MJ_CREATE - it is because I use enable advanced output from filter menu.You said in an earlier post that this happened with a plain installed,
no plugins, npp as well, therefore I’m ignoring possible plugin issues.The output doesn’t provide much new information about the problem,
except for one additional process.
It looks like you are using some kind of synchronization software named Resilio Sync.
I know it sounds weird but could you try to see if it happens as well while this software is temporarily disabled?
In addition, can you check
%APPDATA%\Resilio Sync\ShellExtIO.log
for reporting unusual behavior? -
I shutdown Resilio Sync and the behavior of Notepad++ didn’t change.
-
I checked the Resilio log, and there doesn’t seem to be anything unusual in there.
-
@doubledeej - sorry, I’m running out of ideas.