Skip to content

Commit

Permalink
LF Search 3.46.4
Browse files Browse the repository at this point in the history
  • Loading branch information
shmuz committed Oct 10, 2024
1 parent 5dabf1d commit db3df36
Show file tree
Hide file tree
Showing 7 changed files with 92 additions and 19 deletions.
2 changes: 1 addition & 1 deletion plugins/luafarsearch/build/define.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
-- Definitions
VER_MAJOR = "3"
VER_MINOR = "46"
VER_MICRO = "3"
VER_MICRO = "4"

MINFARVERSION = "{ 3, 0, 0, 4878 }"

Expand Down
3 changes: 3 additions & 0 deletions plugins/luafarsearch/doc/changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
Legend: [+] added; [-] deleted; [*] changed; [!] fixed;
------------------------------------------------------------------

2024-10-10, v3.46.4
[+] Dialog "Persistent settings".

2024-04-13, v3.46.3
[!] Fixes.

Expand Down
2 changes: 1 addition & 1 deletion plugins/luafarsearch/doc/license.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
License of LuaFAR Search v3.x
-----------------------------------

Copyright (C) Shmuel Zeigerman 2009-2023
Copyright (C) Shmuel Zeigerman 2009-2024

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated
Expand Down
9 changes: 9 additions & 0 deletions plugins/luafarsearch/lfs_eng.hlf.mcr
Original file line number Diff line number Diff line change
Expand Up @@ -1587,3 +1587,12 @@ and will not be processed.
The syntax of masks is identical to Far-style ~file masks~@:FileMasks@.
~Contents~@Contents@
@PersistentSettings
$ #Persistent settings#
^#Persistent settings#
The settings that are checked on this dialog persist between Far Manager sessions.
The settings that are not checked will be set to their respective defaults in a next session.
~Contents~@Contents@
5 changes: 5 additions & 0 deletions plugins/luafarsearch/lfs_lang.templ
Original file line number Diff line number Diff line change
Expand Up @@ -1015,4 +1015,9 @@ MErrorCreateOutputFile
"Ошибка создания целевого файла"
upd:

MDlgPersistentSettings
"Persistent settings"
"Постоянные настройки"
"Configuraciones persistentes"

// End file //
9 changes: 9 additions & 0 deletions plugins/luafarsearch/lfs_rus.hlf.mcr
Original file line number Diff line number Diff line change
Expand Up @@ -1605,3 +1605,12 @@ $ #Фильтр папок#
Синтаксис масок идентичен ~Маскам файлов~@:FileMasks@ в стиле Фара.
~Содержание~@Contents@
@PersistentSettings
$ #Постоянные настройки#
^#Постоянные настройки#
Настройки, отмеченные в данном диалоге, сохраняются между сессиями Far Manager.
Неотмеченные настройки будут установлены в значения по умолчанию в следующей сессии.
~Contents~@Contents@
81 changes: 64 additions & 17 deletions plugins/luafarsearch/lfsearch.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
-- The reason: FSF.GetReparsePointInfo() did not work in the range of builds [4425-4876].

local F = far.Flags
local M -- forward declaration
local MenuFlags = bit64.bor(F.FMENU_WRAPMODE, F.FMENU_AUTOHIGHLIGHT)
local PluginConfigGuid1 = win.Uuid("B2C08615-ED7C-491D-BE5C-8758FDAB9139")
local PluginMenuGuid1 = win.Uuid("3D5E7985-3B5D-4777-A572-BA7C621B3731")
Expand All @@ -19,18 +20,63 @@ end
-- Set the defaults: prioritize safety and "least surprise".
local function NormDataOnFirstRun()
local data = _Plugin.History:field("main")
data.bAdvanced = false
data.bConfirmReplace = true
data.bDelEmptyLine = false
data.bDelNonMatchLine = false
data.bGrepInverseSearch = false
data.bInverseSearch = false
data.bMultiPatterns = false
data.bRepIsFunc = false
data.bSearchBack = false
data.bUseDirFilter = false
data.bUseFileFilter = false
data.sSearchArea = "FromCurrFolder"
local pers = _Plugin.History:field("persistent")
local setval = function(name, dflt)
if data[name]==nil or not pers[name] then data[name]=dflt; end
end
setval("bAdvanced" , false)
setval("bConfirmReplace" , true)
setval("bDelEmptyLine" , false)
setval("bDelNonMatchLine" , false)
setval("bGrepInverseSearch" , false)
setval("bInverseSearch" , false)
setval("bMultiPatterns" , false)
setval("bRepIsFunc" , false)
setval("bSearchBack" , false)
setval("bUseDirFilter" , false)
setval("bUseFileFilter" , false)
setval("sSearchArea" , "FromCurrFolder")
end


local function PersistentDialog()
local sd = require "far2.simpledialog"
local items = {
width = 0;
guid="325E21EA-0E78-4FF8-A800-8710896CE606";
help="PersistentSettings";
{tp="dbox"; text=M.MDlgPersistentSettings; },
{tp="chbox"; name="bAdvanced" ; text=M.MDlgAdvanced ; },
{tp="chbox"; name="bConfirmReplace" ; text=M.MDlgConfirmReplace ; },
{tp="chbox"; name="bDelEmptyLine" ; text=M.MDlgDelEmptyLine ; },
{tp="chbox"; name="bDelNonMatchLine" ; text=M.MDlgDelNonMatchLine ; },
{tp="chbox"; name="bGrepInverseSearch"; text=M.MDlgGrepInverseSearch ; },
{tp="chbox"; name="bInverseSearch" ; text=M.MDlgInverseSearch ; },
{tp="chbox"; name="bMultiPatterns" ; text=M.MDlgMultiPatterns ; },
{tp="chbox"; name="bRepIsFunc" ; text=M.MDlgRepIsFunc ; },
{tp="chbox"; name="bSearchBack" ; text=M.MDlgReverseSearch ; },
{tp="chbox"; name="bUseDirFilter" ; text=M.MDlgUseDirFilter ; },
{tp="chbox"; name="bUseFileFilter" ; text=M.MDlgUseFileFilter ; },
{tp="chbox"; name="sSearchArea" ; text=M.MDlgSearchArea ; },
{tp="sep"; },
{tp="butt"; default=1; centergroup=1; text=M.MOk; },
{tp="butt"; cancel=1; centergroup=1; text=M.MCancel; },
}
for _,v in ipairs(items) do
if v.text and v.name then
v.text=v.text:gsub("&",""):gsub(":$","")
v.text = ("%-30s(%s)"):format(v.text, v.name)
end
end

local pers = _Plugin.History:field("persistent")
local dlg = sd.New(items)
dlg:LoadData(pers)
local out = dlg:Run()
if out then
dlg:SaveData(out, pers)
_Plugin.History:save()
end
end


Expand Down Expand Up @@ -68,7 +114,7 @@ local libUtils = require "far2.utils"
local Common = require "lfs_common"
local EditMain = require "lfs_editmain"
local Editors = require "lfs_editors"
local M = require "lfs_message"
M = require "lfs_message"
local MReplace = require "lfs_mreplace"
local Panels = require "lfs_panels" -- call only after modifying package.cpath
local Rename = require "lfs_rename"
Expand Down Expand Up @@ -276,16 +322,17 @@ function export.Configure (Guid) -- luacheck: no unused args
HelpTopic = "Contents",
}
local items = {
{ text=M.MConfigTitleEditor; action=Common.EditorConfigDialog; },
{ text=M.MConfigTitleTmpPanel; action=Panels.ConfigDialog; },
{ text=M.MConfigTitleCommon; action=Common.ConfigDialog; },
{ text=M.MConfigTitleEditor; action=Common.EditorConfigDialog; },
{ text=M.MConfigTitleTmpPanel; action=Panels.ConfigDialog; },
{ text=M.MConfigTitleCommon; action=Common.ConfigDialog; },
{ text=M.MDlgPersistentSettings; action=PersistentDialog; },
}
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 <= 3 then
if pos <= #items then
item.action()
else
libUtils.RunUserItem(item, item.arg)
Expand Down

0 comments on commit db3df36

Please sign in to comment.