From 93ecbb004c8a216d17a8b940572a388f010c94ee Mon Sep 17 00:00:00 2001 From: Don Ho Date: Wed, 30 Oct 2024 01:53:07 +0100 Subject: [PATCH] Fix saved file from new empty doc keeping created time tip issue Fix https://community.notepad-plus-plus.org/topic/26235/notepad-v8-7-1-release-candidate/11?_=1730165549940 --- PowerEditor/src/NppIO.cpp | 5 ++++- PowerEditor/src/ScintillaComponent/Buffer.h | 6 ++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/PowerEditor/src/NppIO.cpp b/PowerEditor/src/NppIO.cpp index 4e189dead..9b6107e42 100644 --- a/PowerEditor/src/NppIO.cpp +++ b/PowerEditor/src/NppIO.cpp @@ -1651,7 +1651,10 @@ bool Notepad_plus::fileSave(BufferID id) { if (buf->isUntitled()) { - return fileSaveAs(bufferID); + bool isOK = fileSaveAs(bufferID); + if (isOK) + buf->clearTabCreatedTimeString(); + return isOK; } const NppGUI & nppgui = (NppParameters::getInstance()).getNppGUI(); diff --git a/PowerEditor/src/ScintillaComponent/Buffer.h b/PowerEditor/src/ScintillaComponent/Buffer.h index cbb122f9b..c7af851b5 100644 --- a/PowerEditor/src/ScintillaComponent/Buffer.h +++ b/PowerEditor/src/ScintillaComponent/Buffer.h @@ -292,6 +292,12 @@ public: _tabCreatedTimeString = getTimeString(now); } } + void clearTabCreatedTimeString() { + if (_currentStatus != DOC_UNNAMED) + { + _tabCreatedTimeString = L""; + } + } size_t docLength() const { assert(_pManager != nullptr);