[FarGroup/FarManager] master: gh-939: ECSTATE_SAVED / ECSTATE_MODIFIED changed their meaning (f1a88e168)

0 views
Skip to first unread message

farg...@farmanager.com

unread,
Oct 4, 2025, 4:30:52 PMOct 4
to farco...@googlegroups.com
Repository : https://github.com/FarGroup/FarManager
On branch : master
Link : https://github.com/FarGroup/FarManager/commit/f1a88e168b973312b006fafc4128bfefeac32e59

>---------------------------------------------------------------

commit f1a88e168b973312b006fafc4128bfefeac32e59
Author: Alex Alabuzhev <alab...@gmail.com>
Date: Sat Oct 4 21:25:21 2025 +0100

gh-939: ECSTATE_SAVED / ECSTATE_MODIFIED changed their meaning

The original meaning restored (more or less)


>---------------------------------------------------------------

f1a88e168b973312b006fafc4128bfefeac32e59
far/changelog | 6 ++++++
far/editor.cpp | 7 +++++--
far/vbuild.m4 | 2 +-
3 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/far/changelog b/far/changelog
index 68ddbf617..5ceb9f784 100644
--- a/far/changelog
+++ b/far/changelog
@@ -1,3 +1,9 @@
+--------------------------------------------------------------------------------
+drkns 2025-10-04 21:05:17+01:00 - build 6570
+
+1. gh-939: ECSTATE_SAVED / ECSTATE_MODIFIED changed their meaning.
+ The original meaning restored (more or less).
+
--------------------------------------------------------------------------------
drkns 2025-10-04 00:00:33+01:00 - build 6569

diff --git a/far/editor.cpp b/far/editor.cpp
index 27a270b7f..0b44a8996 100644
--- a/far/editor.cpp
+++ b/far/editor.cpp
@@ -5604,9 +5604,12 @@ int Editor::EditorControl(int Command, intptr_t Param1, void *Param2)
Info->BookmarkCount=BOOKMARK_COUNT;
Info->SessionBookmarkCount=GetSessionBookmarks(nullptr);
Info->CurState=m_Flags.Check(FEDITOR_LOCKMODE)?ECSTATE_LOCKED:0;
+ // ECSTATE_SAVED means "commited state" or "no unsaved changes" (no * in status bar)
+ // ECSTATE_MODIFIED means "the underlying file has been overwritten at least once" (so it's not the same as it used to be)
+ // It somewhat contradicts the internal nomenclature, so be careful here (and see gh-939).
if (const auto HostFileEditor = GetHostFileEditor())
- Info->CurState |= HostFileEditor->WasFileSaved()? ECSTATE_SAVED : 0;
- Info->CurState|=m_Flags.Check(FEDITOR_MODIFIED)?ECSTATE_MODIFIED:0;
+ Info->CurState |= HostFileEditor->WasFileSaved()? ECSTATE_MODIFIED : 0;
+ Info->CurState |= m_Flags.Check(FEDITOR_MODIFIED)? 0 : ECSTATE_SAVED;
Info->CodePage = GetCodePage();

return true;
diff --git a/far/vbuild.m4 b/far/vbuild.m4
index 549a0b27f..55f59784d 100644
--- a/far/vbuild.m4
+++ b/far/vbuild.m4
@@ -1 +1 @@
-6569
+6570


Reply all
Reply to author
Forward
0 new messages