Hello Xinhong Pu,
Following up on your issue, I want to ensure you have the most reliable information to manage this flaw. After reevaluating the current Microsoft development pipelines and Windows Insider release notes, I can confirm this specific buffer state anomaly remains an unpatched issue within the stable release source code.
Because this is a hardcoded logic flaw within the application's internal text control architecture, there are no valid registry modifications or Group Policy Object overrides to manually enforce the correct save prompt behavior. The absolute best practice to prevent accidental data loss while waiting for an official Microsoft engineering patch is to utilize the native session caching feature. By navigating to the Notepad settings and ensuring the startup behavior is set to "Open content from the previous session," the operating system automatically caches your active text buffer to %LocalAppData%\Packages\Microsoft.WindowsNotepad_8wekyb3d8bbwe\LocalState. This caching mechanism securely preserves your uncommitted strings even when the application closes without warning due to this bug. Please maintain this specific configuration and monitor the Microsoft Store for the future Microsoft.WindowsNotepad package update that will deploy the permanent resolution.
Hope this answer brought you some useful information. If it has, please consider accepting the answer so that other people sharing the same issue would benefit too. Thank you :)
VP