Skip to content

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
shmuz committed Jan 11, 2025
1 parent c07f890 commit f282cfb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
6 changes: 3 additions & 3 deletions far/src/macro/macroapi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1162,9 +1162,9 @@ int64_t KeyMacro::CallFar(int CheckCode, const FarMacroCall* Data)
if (tmpAction.isUnknown())
tmpAction=CheckCode == MCODE_F_MENU_FILTER ? 4 : 0;

int CurMMode = GetArea();
int CurArea = GetArea();

if (IsMenuArea(CurMMode) || CurMMode == MACROAREA_DIALOG)
if (IsMenuArea(CurArea) || CurArea == MACROAREA_DIALOG)
{
if (auto *f = GetTopModal())
{
Expand All @@ -1180,7 +1180,7 @@ int64_t KeyMacro::CallFar(int CheckCode, const FarMacroCall* Data)
FARString NewStr;
if (tmpVar.isString())
NewStr = tmpVar.toString();
if (f->VMProcess(CheckCode,(void*)&NewStr,tmpAction.toInteger()))
if (f->VMProcess(CheckCode,&NewStr,tmpAction.toInteger()))
{
tmpVar=NewStr.CPtr();
success=true;
Expand Down
11 changes: 5 additions & 6 deletions far/src/vmenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1002,27 +1002,26 @@ int64_t VMenu::VMProcess(int OpCode, void *vParam, int64_t iParam)
Если фильтр не был включен - включает его, режим фиксации не трогается, но игнорируется.
Возвращает предыдущее значение строки фильтра.
*/
FARString *ptrStr = (FARString*)vParam;
switch (iParam) {
case 0:
if (bFilterEnabled) {
*(FARString *)vParam = strFilter;
*ptrStr = strFilter;
return 1;
}
break;
case 1:
if (!bFilterEnabled)
bFilterEnabled = true;
bFilterEnabled = true;
bool prevLocked = bFilterLocked;
bFilterLocked = false;
RestoreFilteredItems();
FARString oldFilter = strFilter;
strFilter.Clear();
if (vParam != nullptr)
AddToFilter(((FARString *)vParam)->CPtr());
AddToFilter(ptrStr->CPtr());
FilterStringUpdated(true);
bFilterLocked = prevLocked;
DisplayObject();
*(FARString *)vParam = oldFilter;
*ptrStr = oldFilter;
return 1;
}

Expand Down

0 comments on commit f282cfb

Please sign in to comment.