Skip to content

Deleting a file externally, and then undoing+redoing in notepad++, marks the file as saved even though it isn't #10401

@Pokechu22

Description

@Pokechu22

Steps to Reproduce the Issue

  1. In Windows Explorer, create a new file named test.txt.
  2. Open that file in Notepad++
  3. Enter Test, then hit control+S to save.
  4. Delete the file in Windows Explorer. Either a regular delete/move to recycle bin (delete) or a real delete (shift+delete) will work.
  5. In Notepad++, when prompted to keep the file in editor, select yes.
  6. Undo with control+Z
  7. Redo with control+Y

Expected Behavior

The file should be marked as unsaved, since it is unmodified.

Actual Behavior

After redoing, the file is no longer marked as unsaved, and the save button is greyed out, even though the file no longer exists.

Interestingly, "File → Reload from Disk" and "File → Move to Recycle Bin" are greyed out, consistent with a nonexistent file. Also, Notepad++ detects if the file is created again and prompts to reload it (and also marks the file as dirty in that case, and re-enables those operations). Both of these are useful behaviors that should probably be preserved if this issue is fixed.

Debug Information

Notepad++ v8.1.2   (32-bit)
Build time : Jul 16 2021 - 01:56:21
Path : C:\Program Files (x86)\Notepad++\notepad++.exe
Command Line : 
Admin mode : OFF
Local Conf mode : OFF
Cloud Config : OFF
OS Name : Windows 10 Home (64-bit) 
OS Version : 2009
OS Build : 19042.1165
Current ANSI codepage : 1252
Plugins : DSpellCheck.dll mimeTools.dll NppConverter.dll NppExport.dll 

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions