diff --git a/plugins/luafarhistory/build/define.lua b/plugins/luafarhistory/build/define.lua index 4e8871e..f54f1a2 100644 --- a/plugins/luafarhistory/build/define.lua +++ b/plugins/luafarhistory/build/define.lua @@ -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) diff --git a/plugins/luafarhistory/doc/changelog.txt b/plugins/luafarhistory/doc/changelog.txt index 8bdc3c9..6008701 100644 --- a/plugins/luafarhistory/doc/changelog.txt +++ b/plugins/luafarhistory/doc/changelog.txt @@ -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 diff --git a/plugins/luafarhistory/lfh_config.lua b/plugins/luafarhistory/lfh_config.lua index 3a4380f..a9e1066 100644 --- a/plugins/luafarhistory/lfh_config.lua +++ b/plugins/luafarhistory/lfh_config.lua @@ -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) @@ -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 @@ -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 diff --git a/plugins/luafarhistory/lfhistory.lua b/plugins/luafarhistory/lfhistory.lua index 1e5be9e..f1ce1ab 100644 --- a/plugins/luafarhistory/lfhistory.lua +++ b/plugins/luafarhistory/lfhistory.lua @@ -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; @@ -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) @@ -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" ----------------------------------------------------------------------------------------------- @@ -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" ----------------------------------------------------------------------------------------------- @@ -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()