Skip to content

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
shmuz committed Aug 4, 2024
1 parent 751c8e7 commit d6f9351
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
14 changes: 5 additions & 9 deletions plugins/luafarsearch/lfsearch.lua
Original file line number Diff line number Diff line change
Expand Up @@ -276,21 +276,17 @@ function export.Configure (Guid) -- luacheck: no unused args
HelpTopic = "Contents",
}
local items = {
{ text=M.MConfigTitleCommon },
{ text=M.MConfigTitleEditor },
{ text=M.MConfigTitleTmpPanel },
{ text=M.MConfigTitleEditor; action=Common.EditorConfigDialog; },
{ text=M.MConfigTitleTmpPanel; action=Panels.ConfigDialog; },
{ text=M.MConfigTitleCommon; action=Common.ConfigDialog; },
}
local userItems = libUtils.LoadUserMenu("_usermenu.lua")
libUtils.AddMenuItems(items, userItems.config, M)
while true do
local item, pos = far.Menu(properties, items)
if not item then break end
if pos == 1 then
Common.ConfigDialog()
elseif pos == 2 then
Common.EditorConfigDialog()
elseif pos == 3 then
Panels.ConfigDialog()
if pos <= 3 then
item.action()
else
libUtils.RunUserItem(item, item.arg)
end
Expand Down
2 changes: 1 addition & 1 deletion plugins/polygon/modules/panel.lua
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,7 @@ function mypanel:get_panel_list_obj()
-- IMPORTANT: field 'Owner' is used for holding ROWID
item.Owner = rowid
-- use ROWID as file name, otherwise FAR cannot properly handle selections on the panel
item.FileName = ("%010s"):format(rowid)
item.FileName = ("%010d"):format(rowid)
else
for i = 1,#self._col_info do
item.CustomColumnData[i] = exporter.get_text(stmt, i-1, true)
Expand Down
2 changes: 1 addition & 1 deletion plugins/polygon/polygon.lua
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ end

local function Analyse(FileName, Buffer, OpMode)
return
band(OpMode,F.OPM_TOPLEVEL) == 0 -- not supposed to process ShiftF1/F2/F3
band(OpMode, F.OPM_TOPLEVEL+F.OPM_FIND) == 0 -- not supposed to process ShiftF1/F2/F3
and FileName
and FileName ~= ""
and dbx.format_supported(Buffer, #Buffer)
Expand Down

0 comments on commit d6f9351

Please sign in to comment.