Skip to content

Commit

Permalink
Revert 6296
Browse files Browse the repository at this point in the history
  • Loading branch information
shmuz committed Mar 26, 2024
1 parent c6fab8a commit d0de7a2
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
5 changes: 5 additions & 0 deletions far/changelog
Original file line number Diff line number Diff line change
@@ -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

Expand Down
14 changes: 8 additions & 6 deletions far/macro.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,7 @@ struct DlgParam
FARMACROAREA Area;
DWORD Key;
int Recurse;
bool Changed;
};

static bool ToDouble(long long v, double& d)
Expand Down Expand Up @@ -666,17 +667,17 @@ 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);
// добавим проверку на удаление
// если удаляем или был вызван диалог изменения, то не нужно выдавать диалог настройки.
//if (MacroKey != (DWORD)-1 && (Key==KEY_CTRLSHIFTDOT || Recording==2) && RecBufferSize)
if (ctrlshiftdot && !GetMacroSettings(MacroKey,Flags))
{
AssignRet=false;
AssignRet=0;
}
}
m_InternalInput=0;
Expand Down Expand Up @@ -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;
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion far/macro.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion far/vbuild.m4
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6296
6297

0 comments on commit d0de7a2

Please sign in to comment.