Skip to content

Commit

Permalink
LF History 3.13.0
Browse files Browse the repository at this point in the history
  • Loading branch information
shmuz committed Nov 16, 2023
1 parent a02af5b commit 3092e17
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 11 deletions.
4 changes: 2 additions & 2 deletions plugins/luafarhistory/build/define.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-- Definitions
VER_MAJOR = "3"
VER_MINOR = "12"
VER_MICRO = "2"
VER_MINOR = "13"
VER_MICRO = "0"

MINFARVERSION = "{ 3, 0, 0, 3812 }" -- 3.0.0.4364 for non-embedded plugin build (-DRUN_LUAFAR_INIT)

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

2023-11-15, v3.13.0
[+] Support RGB colors (see General settings -> Colors)

2023-11-05, v3.12.2
[!] Fix in custommenu module

Expand Down
7 changes: 3 additions & 4 deletions plugins/luafarhistory/lfh_config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
local F = far.Flags
local sd = require "far2.simpledialog"
local M = require "lfh_message"
local DlgSend = far.SendDlgMessage
local main

local function Init(data)
Expand Down Expand Up @@ -70,10 +69,10 @@ local function ConfigDialog ()
if msg == F.DN_BTNCLICK then
if param1 == Pos.btnHighTextColor then
local c = far.ColorDialog(hColor0)
if c then hColor0 = c; DlgSend(hDlg,F.DM_REDRAW); end
if c then hColor0 = c; hDlg:send("DM_REDRAW"); end
elseif param1 == Pos.btnSelHighTextColor then
local c = far.ColorDialog(hColor1)
if c then hColor1 = c; DlgSend(hDlg,F.DM_REDRAW); end
if c then hColor1 = c; hDlg:send("DM_REDRAW"); end
end

elseif msg == F.DN_CTLCOLORDLGITEM then
Expand Down Expand Up @@ -179,7 +178,7 @@ local function ConfigMenu()
{ tag="folders"; data=M.mMenuFolders .. ": " ..M.mExclusions; },
}
local j = 1
for i,v in ipairs(Items) do
for _,v in ipairs(Items) do
if v.separator==nil then
v.text = ("&%d. %s"):format(j, v.data)
j = j+1
Expand Down
14 changes: 9 additions & 5 deletions plugins/luafarhistory/lfhistory.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ local DefaultCfg = {
bShowDates = true,
bKeepSelectedItem = false,
bDirectSort = true,
HighTextColor = 0x3A,
SelHighTextColor = 0x0A,
HighTextColor = { ForegroundColor=0xFF00FF00; BackgroundColor=0xFF008080; },
SelHighTextColor = { ForegroundColor=0xFF00FF00; BackgroundColor=0xFF000000; },
iDateFormat = 2,
view = {
iSize = 1000;
Expand Down Expand Up @@ -130,7 +130,7 @@ local function IsCtrlPgDn (key) return key=="CtrlPgDn" or key=="RCtrlPgDn" end

local function ExecuteFromCmdLine(str, newwindow)
panel.SetCmdLine(nil, str)
far.MacroPost(newwindow and 'Keys"ShiftEnter"' or 'Keys"Enter"')
far.MacroPost(newwindow and "Keys('ShiftEnter')" or "Keys('Enter')")
end

local function GetTimeString (filetime)
Expand Down Expand Up @@ -280,7 +280,7 @@ local function GetListKeyFunction (aConfig, aData)
or GetFileAttrEx(t.text) or t.checked end,
function(n) return 1 == far.Message((M.mDeleteItemsQuery):format(n),
M.mDeleteNonexistentTitle, ";YesNo", "w") end)
hDlg:send("DM_REDRAW", 0, 0)
hDlg:send("DM_REDRAW")
end
return "done"
-----------------------------------------------------------------------------------------------
Expand All @@ -295,7 +295,7 @@ local function GetListKeyFunction (aConfig, aData)
function(t) return t.checked end,
function(n) return 1 == far.Message((M.mDeleteItemsQuery):format(n),
M.mDeleteItemsTitle, ";YesNo", "w") end)
hDlg:send("DM_REDRAW", 0, 0)
hDlg:send("DM_REDRAW")
end
return "done"
-----------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -750,6 +750,10 @@ do
_Plugin = {}
_Plugin.History = LibHistory.newsettings(nil, "config", "PSL_ROAMING")
_Plugin.Cfg = _Plugin.History:field("config")

-- older LF History versions stored colors as integers
if type(_Plugin.Cfg.HighTextColor)~="table" then _Plugin.Cfg.HighTextColor=nil end
if type(_Plugin.Cfg.SelHighTextColor)~="table" then _Plugin.Cfg.SelHighTextColor=nil end
end
FillDefaults(_Plugin.Cfg, DefaultCfg)
InitConfigModule()
Expand Down

0 comments on commit 3092e17

Please sign in to comment.