V1.0.0 implementation#2
Merged
Merged
Conversation
Reorganizes the repo to follow the standard .NET layout where shipping code lives under the project name and tests live under tests/. The solution file, project reference, and CI workflow path are updated to match. The README's Architecture section now explicitly explains the purpose of the test project; CONTRIBUTING.md gives a full project- structure walkthrough for new contributors plus what's covered by automated tests vs. manual smoke tests.
Both items are file-only and disabled for unsaved buffers (non-rooted paths). Process.Start is wrapped in using() so the returned Process handle does not leak per invocation.
The panel was previously lazy-created on first menu click, by which time Notepad++'s docking manager had already applied its saved layout. Moving creation + DMM registration into OnNppReady lets Notepad++ restore the panel's last-session visibility automatically. OnShowPanel reduces to a visibility toggle. README updated to list the Reveal in Explorer / Copy full path entries in the file-operations section, and the roadmap section is trimmed to reflect what has shipped.
Without this, every open buffer fires NPPN_FILEBEFORECLOSE during shutdown, each one removing its file from the virtual tree before state.json is saved. After restart the user's folders persisted but every file they had open at shutdown was gone. Listen for NPPN_BEFORESHUTDOWN to set a shutdown flag; restore it on NPPN_CANCELSHUTDOWN (user backed out of save-dirty-files dialog). Skip OnFileClosed cleanup while the flag is set so the tree survives intact. Adds NPPN_BEFORESHUTDOWN/NPPN_CANCELSHUTDOWN to the local enum.
Previously, all non-rooted entries were stripped on load, so unsaved-buffer references like "new 32" never survived a restart. With Notepad++'s session backup enabled, those buffers DO persist with the same name across launches, and the virtual entries were being deleted needlessly. On NPPN_READY, fetch the current open-file list via NPPM_GETOPENFILENAMES and only purge unsaved entries whose name doesn't match a live buffer. Entries with a matching buffer stay; rooted (saved) entries always stay.
Per-path enumeration was only needed to verify NPPM_GETOPENFILENAMES vs. stored paths during the smart-purge bring-up. The logic is confirmed working, so reduce log noise to one line that only fires when entries are actually purged.
OnNppShutdown previously only disposed the state store, leaving the panel form (which owns a ToolTip, cached GDI brushes/pens, and an embedded DarkAwareTreeView) and the 16x16 tab Icon to be finalized off-thread once Notepad++ tore its window tree down. Dispose them synchronously so all managed resources are released by the time Notepad++ regains control. Adds shutdown breadcrumbs (entered / complete-in-Nms) so we can spot any future shutdown-path regression without re-instrumenting from scratch.
… delay README updates for the recent persistence work: - Add a Persistence bullet for the new panel-visibility-survives-restart behavior (eager registration on NPPN_READY). - Replace the stale "unsaved buffers are session-only" bullet with the correct smart-purge story: unsaved buffers survive a restart when Notepad++'s session backup is enabled, and stale references are silently cleaned up when it isn't. - Note that auto-removal is suspended during Notepad++ shutdown so the per-tab close notifications don't strip every open file from the tree. - Troubleshooting: add an explanation of the "Notepad++ takes two clicks to relaunch" symptom — caused by Notepad++ writing session backups for unsaved buffers, not the plugin (confirmed with plugin.log; our shutdown completes in ~30 ms).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.