Skip to content

Commit

Permalink
Polygon 1.8.4
Browse files Browse the repository at this point in the history
  • Loading branch information
shmuz committed Sep 9, 2024
1 parent d6f9351 commit 5aa0b2e
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 6 deletions.
4 changes: 2 additions & 2 deletions lua_share/far2/custommenu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ end

function List:MouseEvent (hDlg, Ev, x, y)
if osWindows and Ev.EventFlags == F.MOUSE_WHEELED then
self:KeyMsWheel(Ev.ButtonState < 0x80000000 and "down" or "up")
self:KeyMsWheel(Ev.ButtonState < 0x80000000 and "up" or "down")
SendRedrawMessage(hDlg)
return
end
Expand Down Expand Up @@ -779,7 +779,7 @@ function List:KeyMsWheel (dir)
local N = #self.drawitems
if N > 0 then
for k=1,2 do -- loop to skip a separator
if dir == "down" then
if dir == "up" then
if self.sel==1 or self.sel==2 and self.drawitems[1].separator then
break
end
Expand Down
8 changes: 6 additions & 2 deletions lua_share/far2/simpledialog.lua
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,18 @@ function mod.OpenInEditor(text, ext)
if OpSys == "windows" then
tempdir = win.GetEnv("TEMP")
if not tempdir then
far.Message("Environment variable TEMP is not set", "Error", nil, "w"); return nil
far.Message("Environment variable TEMP is not set", "Error", nil, "w")
return nil
end
else
tempdir = far.InMyTemp()
end
if tempdir:sub(-1) ~= DirSep then tempdir = tempdir..DirSep end

ext = type(ext)=="string" and ext or ".tmp"
if ext~="" and ext:sub(1,1)~="." then ext = "."..ext; end
local fname = ("%s%sFar-%s%s"):format(tempdir, DirSep, win.Uuid(win.Uuid()):sub(1,8), ext)

local fname = ("%sFar-%s%s"):format(tempdir, win.Uuid(win.Uuid()):sub(1,8), ext)
local fp = io.open(fname, "wb")
if fp then
fp:write(text or "")
Expand Down
2 changes: 1 addition & 1 deletion plugins/polygon/build/define.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-- Definitions
VER_MAJOR = "1"
VER_MINOR = "8"
VER_MICRO = "3"
VER_MICRO = "4"

-- Far >= 3.0.4364 required if -DRUN_LUAFAR_INIT is used
-- Far >= 3.0.4401 required if more than 10 DB table columns must be supported
Expand Down
3 changes: 3 additions & 0 deletions plugins/polygon/doc/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
2024-09-09, v.1.8.4
1. Added sort direction indicators (can be edited in LNG files).

2024-06-09, v.1.8.3
1. Refactor to not depend on bit64 __tostring metamethod.

Expand Down
5 changes: 4 additions & 1 deletion plugins/polygon/modules/panel.lua
Original file line number Diff line number Diff line change
Expand Up @@ -869,6 +869,9 @@ function mypanel:prepare_panel_info(handle)
self:FillKeyBar(info.key_bar, "db")
-------------------------------------------------------------------------------------------------
else -- self._panel_mode == "table"/"view"/"query"
local pInfo = panel.GetPanelInfo(handle)
local sort_reverse = bit64.band(pInfo.Flags, F.PFLAGS_REVERSESORTORDER) ~= 0
local sort_char = sort_reverse and M.sort_descend or M.sort_ascend
local cur = self._tables[self._objname]
local masks = self._col_masks_used[self._objname] and cur and cur.col_masks
local show_affinity = self._panel_mode=="table" and self._show_affinity
Expand All @@ -881,7 +884,7 @@ function mypanel:prepare_panel_info(handle)
end
col_types = col_types .. "C" .. (i-1)
col_widths = col_widths .. width
local head = i == self._sort_col_index and "" or ""
local head = i == self._sort_col_index and sort_char or ""
local tail = show_affinity and affinity_map[descr.affinity] or ""
table.insert(col_titles, head..descr.name..tail)
end
Expand Down
8 changes: 8 additions & 0 deletions plugins/polygon/polygon_lang.templ
Original file line number Diff line number Diff line change
Expand Up @@ -308,3 +308,11 @@ label_table_name
label_column_name
"Column"
"Колонка"

sort_ascend
""
""

sort_descend
""
""

0 comments on commit 5aa0b2e

Please sign in to comment.