Sometimes Notepad++ doesn't save even though it appears to.



  • I am using the current release of Notepad++.

    Sometimes when I save a document in Notepad++, it says it saves (red “unsaved” icon turns gray) but the file on disk doesn’t change. This can be very frustrating especially when debugging something. To fix it, I have to select the entire document, copy it, close the file, reopen it and paste in the copied text. Then when I save it will work.

    This only happens sometimes, but it has been troubling me for the last few releases. I only save locally, not to any shared drives.

    Help!



  • It sounds to me like your file is read-only. A normal file will have a blue file icon, a changed file is red, and a read-only file is gray. With the version of NPP I’m using (7.4.2) editing is disabled on a read-only file, so I’m not sure what’s going on in your case, but saving should not turn the icon gray. Maybe you have a permissions issue, or something else is changing attributes on the file while you have it open. I would look at those types of things and if nothing helps, I’d reinstall. Reinstalling is a decent straw to grasp at, it’s pretty painless and it may surprise you.



  • @pbarney
    notepad++ 7.5.1 will not allow or mark it as saved if it can not be saved (tested now)

    however, if you edit a file which is in a dropbox, cloud station, one drive, own cloud or any other sync drive which is connected to another sync client of yours currently online, it sometimes may come to exactly what you described and revert the saved file to an older state

    if you are saving to a dropbox like sync folder and have those issues, you can disable your sync temporarily while you are editing the file and resume sync once everything is saved



  • I’m sorry, the icon is blue. It looked gray when it was the selected tab. The file is not read-only.

    I am not using dropbox. This is a local-only file in an unshared folder, as normal as normal gets. I am not using any code-monitoring tools that may have opened the file in the background.

    Is there a chance that any plug-in is causing this behavior?



  • @pbarney

    Is there a chance that any plug-in is causing this behavior?

    maybe.

    you can test this possibility by downloading the portable version of np++ 7.5.1 from the link below
    extract it anywhere (desktop will do) and test with this fresh and isolated install to see if the problem remains

    the portable version allows you to leave your currently installed version as it is and test everything, without external plugins

    https://notepad-plus-plus.org/repository/7.x/7.5.1/npp.7.5.1.bin.zip



  • I have exactly this strange problem too in latest version (v7.5.1 Portable)
    Sometimes when i edit an existing text file on local HDD and press blue save icon in toolbar (toolbar icon change to gray and red tab icon is changed to blue, that means file is successfully saved) and close program and reopen file again, my added text to file is missed and disappear!
    This problem happening on local file sometimes (not Dropbox or any other sharing file) and not any software monitoring running when this problem happend. I using “Notepad++ minimalist package portable” version with just single plugin (CustomizeToolbar)
    This is certainly a bug because when happen on one file, when you open that file quickly again and edit it and saving it again, when check it saved true.

    Is possible or exist any way (Plugin) that i can ensure my file is saved correctly as i see, for fix this bug? (Hash compare or something like that)


    More info: (Maybe helped to fix bug)
    I disabled “Remember current session for next launch” and in the last two times this problem happen i have opened two instance of Notepad++ and editing two file at the same time.

    Debug Info:
    Notepad++ v7.5.1 (32-bit)
    Build time : Aug 29 2017 - 02:35:41
    Path : D:\Softwares\Type & Text\Notepad++\notepad++.exe
    Admin mode : OFF
    Local Conf mode : ON
    OS : Windows 8.1 (64-bit)
    Plugins : CustomizeToolbar.dll



  • @Persia-Cr

    Could it be that the files in question are those which do have a 64bit and 32bit version.
    There is an issue when using 32bit notepad++ on 64bit windows and trying to edit
    64bit files - you get silently redirected to the 32bit version of those files.
    If this is the case you might consider the sysnative alias for opening the files.

    Cheers
    Claudia



  • This bug is relatively new – it started about a couple of years ago. I ran into it several times today when breaking a big js file (UTF8) into new ones (ANSI by Notepad++'s default). I think it happens when you create a new file within Notepad++, copy some content on it, save, then edit it afterwards. After a while, no changes are commited to disk despite the UI saying otherwise.

    Not tested this exhaustively yet. Would be nice if somebody else could confirm this. Thanks.



  • I generally have issues with new files too. What I do is:

    • create a new file using Ctrl+N
    • type in a tiny bit of text
    • use Save As to save the new file with the file location/name I want
    • Close the new file without saving it
    • Open the file I saved it as.

    No problems after that! :-)



  • What I could see:
    If you use a file encoded in UTF8 and including accents, no problem.
    If I open this file and modify the text by removing the accents, when I save the file and open the file, it is in ANSI.

    The file is automatically saved in ANSI.



  • @Jean-Marc-Contet

    If a UTF-8 file without a BOM contains no “accent” characters, then there is no way to distinguish it from an ANSI file.

    When Notepdad++ is set to auto-detect the file type, it indicates in the status bar that the file is ANSI. That doesn’t change anything about the file. It is still a valid UTF-8 without BOM file and a valid ANSI file. One is free to call it either!

    Edit: change “all” to “call” in the last line above.



  • @Rubem-Pechansky said:

    This bug is relatively new – it started about a couple of years ago. I ran into it several times today when breaking a big js file (UTF8) into new ones (ANSI by Notepad++'s default). I think it happens when you create a new file within Notepad++, copy some content on it, save, then edit it afterwards. After a while, no changes are commited to disk despite the UI saying otherwise.

    Not tested this exhaustively yet. Would be nice if somebody else could confirm this. Thanks.

    Just to add: the problem seems to occur under the circumstances above when you have either multiple instances or files in the ‘Other View’. I haven’t been able to replicate it consistently yet.

    Best,



  • welcome to the notepad++ community, @Vinicius-Gottin

    Just to add: the problem seems to occur under the circumstances above when you have either multiple instances or files in the ‘Other View’. I haven’t been able to replicate it consistently yet.

    thank you for taking the time to report this.
    please keep us informed whether you found a way to reproduce it consistently.


Log in to reply