diff --git a/far/changelog b/far/changelog index e96690ed6e..d552287a2e 100644 --- a/far/changelog +++ b/far/changelog @@ -1,3 +1,8 @@ +-------------------------------------------------------------------------------- +shmuel 2024-03-26 13:55:22+02:00 - build 6297 + +1. Revert 6296. + -------------------------------------------------------------------------------- shmuel 2024-03-26 03:59:57+02:00 - build 6296 diff --git a/far/macro.cpp b/far/macro.cpp index 177e6dc8d0..68eb68d5ea 100644 --- a/far/macro.cpp +++ b/far/macro.cpp @@ -366,6 +366,7 @@ struct DlgParam FARMACROAREA Area; DWORD Key; int Recurse; + bool Changed; }; static bool ToDouble(long long v, double& d) @@ -666,9 +667,9 @@ bool KeyMacro::ProcessEvent(const FAR_INPUT_RECORD *Rec) DWORD MacroKey; // выставляем флаги по умолчанию. unsigned long long Flags = 0; - bool AssignRet=AssignMacroKey(MacroKey,Flags); + int AssignRet=AssignMacroKey(MacroKey,Flags); - if (AssignRet && !m_RecCode.empty()) + if (AssignRet && AssignRet!=2 && !m_RecCode.empty()) { m_RecCode = concat(L"Keys(\""sv, m_RecCode, L"\")"sv); // добавим проверку на удаление @@ -676,7 +677,7 @@ bool KeyMacro::ProcessEvent(const FAR_INPUT_RECORD *Rec) //if (MacroKey != (DWORD)-1 && (Key==KEY_CTRLSHIFTDOT || Recording==2) && RecBufferSize) if (ctrlshiftdot && !GetMacroSettings(MacroKey,Flags)) { - AssignRet=false; + AssignRet=0; } } m_InternalInput=0; @@ -5052,6 +5053,7 @@ intptr_t KeyMacro::AssignMacroDlgProc(Dialog* Dlg,intptr_t Msg,intptr_t Param1,v if (GetMacroSettings(key, Data.Flags, strBufKey, strDescription)) { KMParam->Flags = Data.Flags; + KMParam->Changed = true; // в любом случае - вываливаемся Dlg->SendMessage(DM_CLOSE, 1, nullptr); return TRUE; @@ -5076,7 +5078,7 @@ intptr_t KeyMacro::AssignMacroDlgProc(Dialog* Dlg,intptr_t Msg,intptr_t Param1,v return Dlg->DefProc(Msg,Param1,Param2); } -bool KeyMacro::AssignMacroKey(DWORD &MacroKey, unsigned long long& Flags) +int KeyMacro::AssignMacroKey(DWORD &MacroKey, unsigned long long& Flags) { /* 1 2 3 @@ -5112,11 +5114,11 @@ bool KeyMacro::AssignMacroKey(DWORD &MacroKey, unsigned long long& Flags) Global->IsProcessAssignMacroKey--; if (Dlg->GetExitCode() < 0) - return false; + return 0; MacroKey = Param.Key; Flags = Param.Flags; - return true; + return Param.Changed ? 2 : 1; } #ifdef ENABLE_TESTS diff --git a/far/macro.hpp b/far/macro.hpp index 72dcf545d3..622bbe44ca 100644 --- a/far/macro.hpp +++ b/far/macro.hpp @@ -117,7 +117,7 @@ class KeyMacro: noncopyable private: static int GetExecutingState(); intptr_t AssignMacroDlgProc(Dialog* Dlg,intptr_t Msg,intptr_t Param1,void* Param2); - bool AssignMacroKey(DWORD& MacroKey, unsigned long long& Flags); + int AssignMacroKey(DWORD& MacroKey, unsigned long long& Flags); bool GetMacroSettings(int Key, unsigned long long &Flags, string_view Src = {}, string_view Descr = {}); intptr_t ParamMacroDlgProc(Dialog* Dlg,intptr_t Msg,intptr_t Param1,void* Param2); void RestoreMacroChar() const; diff --git a/far/vbuild.m4 b/far/vbuild.m4 index db19baab56..9c0b82b6a7 100644 --- a/far/vbuild.m4 +++ b/far/vbuild.m4 @@ -1 +1 @@ -6296 +6297