This should work fine in any case
```lua
local start, stop
local n1, n2 = geany.select()
if n1 > n2 then
  start, stop = n2, n1
else
  start, stop = n1, n2
end
local line, column = geany.rowcol(start)
start = geany.scintilla("SCI_POSITIONFROMLINE", line - 1)
line, column = geany.rowcol(stop)
stop = geany.scintilla("SCI_GETLINEENDPOSITION", line - 1)
geany.select(start, stop)
local sel = geany.selection()
sel = string.gsub(sel, "[^\r\n]+", "")
geany.selection(sel)
if n1 > n2 then geany.select(start) end

--[[
local script = string.gsub(geany.script, "^[^\r\n]+" .. geany.dirsep .. "([^" 
.. geany.dirsep .. "]+)$", "%1")
geany.status(script .. ": Done!")
]]
```

-- 
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/discussions/4047#discussioncomment-11262881
You are receiving this because you are subscribed to this thread.

Message ID: <geany/geany/repo-discussions/4047/comments/[email protected]>

Reply via email to