Skif-off left a comment (geany/geany#4645)

Maybe [GeanyLua](https://plugins.geany.org/geanylua.html) and something like
```lua
-- Open-file.lua (cross-platform)
-- 2026.08.09
--[[
https://github.com/geany/geany/issues/4645

Supports some simple environment variables: \$[A-Z]+ or %[A-Za-z]+%
]]

local sFN = geany.input("Enter file name:")
if sFN == nil then return end

local sT = string.sub(sFN, 1, 2)
if (sT  == "~/") or (sT  == "~\\") then
  if geany.dirsep == "/" then
    sFN = "$HOME/" .. string.sub(sFN, 3, -1)
  else
    sFN = "%USERPROFILE%\\" .. string.sub(sFN, 3, -1)
  end
end
if geany.dirsep == "/" then
  sFN = string.gsub(sFN, "%$([A-Z]+)", os.getenv)
else
  sFN = string.gsub(sFN, "%%([A-Za-z]+)%%", os.getenv)
end

local sFD, sOF, iR
local aFN = geany.stat(sFN)
if aFN == nil then
  sFD = geany.dirname(sFN)
  if geany.stat(sFD) == nil then
    geany.message('File "' .. sFN .. '" not found.\nDirectory "' .. sFD .. '" 
not found.')
    return
  else
    sOF = geany.pickfile("open", sFD, nil)
    if sOF == nil then return end
    iR = geany.open(sOF)
  end
else
  iR = geany.open(sFN)
end
if iR == 0 then
  geany.message("Fail.")
end
```
?

-- 
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/issues/4645#issuecomment-5239502199
You are receiving this because you are subscribed to this thread.

Message ID: <geany/geany/issues/4645/[email protected]>

Reply via email to