Skip to content

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
shmuz committed Sep 23, 2024
1 parent e5cc9d0 commit 55e38fe
Show file tree
Hide file tree
Showing 5 changed files with 16 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-09-23 10:13:10+03:00 - build 6373

1. Refactoring.

--------------------------------------------------------------------------------
drkns 2024-09-22 22:30:28+01:00 - build 6372

Expand Down
8 changes: 4 additions & 4 deletions far/macro.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ static bool TryToPostMacro(FARMACROAREA Area,const string& TextKey,DWORD IntKey)

KeyMacro::KeyMacro():
m_Area(MACROAREA_SHELL),
m_StartMode(MACROAREA_OTHER),
m_StartArea(MACROAREA_OTHER),
m_Recording(MACROSTATE_NOMACRO)
{
}
Expand Down Expand Up @@ -573,7 +573,7 @@ bool KeyMacro::ProcessEvent(const FAR_INPUT_RECORD *Rec)
}

// Где мы?
m_StartMode=m_Area;
m_StartArea=m_Area;
// В зависимости от того, КАК НАЧАЛИ писать макрос, различаем общий режим (Ctrl-.
// с передачей плагину кеев) или специальный (Ctrl-Shift-. - без передачи клавиш плагину)
m_Recording=ctrldot?MACROSTATE_RECORDING_COMMON:MACROSTATE_RECORDING;
Expand Down Expand Up @@ -622,7 +622,7 @@ bool KeyMacro::ProcessEvent(const FAR_INPUT_RECORD *Rec)
{
const auto strKey = KeyToText(MacroKey);
Flags |= m_Recording == MACROSTATE_RECORDING_COMMON? MFLAGS_NONE : MFLAGS_NOSENDKEYSTOPLUGINS;
LM_ProcessRecordedMacro(m_StartMode, strKey, m_RecCode, Flags, m_RecDescription);
LM_ProcessRecordedMacro(m_StartArea, strKey, m_RecCode, Flags, m_RecDescription);
}

m_Recording=MACROSTATE_NOMACRO;
Expand Down Expand Up @@ -1536,7 +1536,7 @@ int KeyMacro::AssignMacroKey(DWORD &MacroKey, unsigned long long& Flags)
{DI_COMBOBOX, {{5, 3}, {28, 3}}, DIF_FOCUS | DIF_DEFAULTBUTTON, },
});

DlgParam Param{ Flags, m_StartMode, 0 };
DlgParam Param{ Flags, m_StartArea, 0 };
Global->IsProcessAssignMacroKey++;
const auto Dlg = Dialog::create(MacroAssignDlg, std::bind_front(&KeyMacro::AssignMacroDlgProc, this), &Param);
Dlg->SetPosition({ -1, -1, 34, 6 });
Expand Down
2 changes: 1 addition & 1 deletion far/macro.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ class KeyMacro: noncopyable
void RestoreMacroChar() const;

FARMACROAREA m_Area;
FARMACROAREA m_StartMode;
FARMACROAREA m_StartArea;
FARMACROSTATE m_Recording;
string m_RecCode;
string m_RecDescription;
Expand Down
7 changes: 5 additions & 2 deletions far/macroapi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "filemasks.hpp"
#include "filepanels.hpp"
#include "flink.hpp"
#include "history.hpp"
#include "global.hpp"
#include "interf.hpp"
#include "keyboard.hpp"
Expand Down Expand Up @@ -1715,8 +1716,10 @@ void FarMacroApi::promptFunc() const

const auto oldHistoryDisable = GetHistoryDisableMask();

if (history.empty()) // Mantis#0001743: Возможность отключения истории
SetHistoryDisableMask(8); // если не указан history, то принудительно отключаем историю для ЭТОГО prompt()
// Mantis#0001743: Возможность отключения истории
// если не указан history, то принудительно отключаем историю для ЭТОГО prompt()
if (history.empty())
SetHistoryDisableMask(1 << HISTORYTYPE_DIALOG);

if (GetString(title, prompt, history, src, strDest, {}, (Flags&~FIB_CHECKBOX) | FIB_ENABLEEMPTY))
PassValue(strDest);
Expand Down
2 changes: 1 addition & 1 deletion far/vbuild.m4
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6372
6373

0 comments on commit 55e38fe

Please sign in to comment.