Skip to content

Commit

Permalink
Merge pull request elfmz#2328 from rampitec/check-inside-plugin
Browse files Browse the repository at this point in the history
Fix CheckInsidePlugin for non-panel plugins
  • Loading branch information
elfmz authored Aug 12, 2024
2 parents 5670315 + 0e47a56 commit a7d56c1
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 1 deletion.
4 changes: 3 additions & 1 deletion far2l/src/macro/macro.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6440,7 +6440,9 @@ BOOL KeyMacro::CheckEditSelected(DWORD CurFlags)

BOOL KeyMacro::CheckInsidePlugin(DWORD CurFlags)
{
if (CtrlObject && CtrlObject->Plugins.CurPluginItem && (CurFlags & MFLAGS_NOSENDKEYSTOPLUGINS)) // ?????
if (CtrlObject && (CtrlObject->Plugins.CurPluginItem ||
CtrlObject->Plugins.CheckFlags(PSIF_ENTERTOOPENPLUGIN)) &&
(CurFlags & MFLAGS_NOSENDKEYSTOPLUGINS)) // ?????
// if(CtrlObject && CtrlObject->Plugins.CurEditor && (CurFlags&MFLAGS_NOSENDKEYSTOPLUGINS))
return FALSE;

Expand Down
2 changes: 2 additions & 0 deletions far2l/src/plug/plugins.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1753,7 +1753,9 @@ Plugin *PluginManager::FindPlugin(DWORD SysID)

HANDLE PluginManager::OpenPlugin(Plugin *pPlugin, int OpenFrom, INT_PTR Item)
{
Flags.Set(PSIF_ENTERTOOPENPLUGIN);
HANDLE hPlugin = pPlugin->OpenPlugin(OpenFrom, Item);
Flags.Clear(PSIF_ENTERTOOPENPLUGIN);

if (hPlugin != INVALID_HANDLE_VALUE) {
PluginHandle *handle = new PluginHandle;
Expand Down
1 change: 1 addition & 0 deletions incsrch/REG/^#enter.reg
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ REGEDIT4
"DisableOutput"=dword:00000001
"Description"="Search previous selection"
"NoInsidePlugin"=dword:00000001
"NoSendKeysToPlugins"=dword:00000001
1 change: 1 addition & 0 deletions incsrch/REG/^enter.reg
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ REGEDIT4
"DisableOutput"=dword:00000001
"Description"="Search next selection"
"NoInsidePlugin"=dword:00000001
"NoSendKeysToPlugins"=dword:00000001
18 changes: 18 additions & 0 deletions incsrch/key_macros.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Incremental search
[KeyMacros/Editor/CtrlI]
DisableOutput=0x1
Sequence=F11 I Home Enter

# Search selected next
[KeyMacros/Editor/CtrlEnter]
DisableOutput=0x1
NoInsidePlugin=0x1
NoSendKeysToPlugins=0x1
Sequence=F11 I Home Down Down Enter

# Search selected previous
[KeyMacros/Editor/CtrlShiftEnter]
DisableOutput=0x1
NoInsidePlugin=0x1
NoSendKeysToPlugins=0x1
Sequence=F11 I Home Down Down Down Enter

0 comments on commit a7d56c1

Please sign in to comment.