RickStrahl / MarkdownMonster

An extensible Markdown Editor, Viewer and Weblog Publisher for Windows
https://markdownmonster.west-wind.com
Other
1.59k stars 235 forks source link

Renaming file in tree view does not rename file loaded in the tab #1141

Closed internationils closed 3 weeks ago

internationils commented 1 month ago

I renamed a file on the left side in the tree view, and the name in the tab did not change. When saving the tab a duplicate was created with the old name. image

RickStrahl commented 1 month ago

Took a look and found this to be highly inconsistent. This is a weird timing where shutdown of the old tab is not quite complete when the new tab is created and cause an odd cyclical redundancy.

I think this is fixed with some optimizations and some extra wait time before opening the new tab to ensure the tab headers have a time to normalize.

Also updated the actual 'rename' code which previously had a path through that would not delete the original file. We moved to File.Move() now that .NET 8+ has an overwrite parameter which makes this a single atomic OS operation.

Updated in the preview release 3.5.0.11