Skif-off left a comment (geany/geany-plugins#1567)

The Addons plugin uses Geany's built-in feature as is (see "Mark All" 
(Ctrl-Shift-M) in Search > More) and I'm not sure anyone would want to improve 
the plugin (or maybe Geany): otherwise, it has probably already been done.

For example, case-insensitive implementation of "Mark All" for GeanyLua:
```lua
-- Mark-selected-text.lua (cross-platform)
-- 2026.06.17
--[[
Mark selected text in all document.
Like "Mark All" (Ctrl-Shift-M by default), but case-insensitive.
]]

local sT = geany.selection()
if sT == nil then
  geany.message("There is no open document!")
  return
elseif sT == "" then
  geany.message("No text is selected!")
  return
end

-- Clear previous search indicators
-- SCI_GETLENGTH
local iL = geany.scintilla(2006, 0, 0)
if iL > 0 then
  -- SCI_SETINDICATORCURRENT ÷ GEANY_INDICATOR_SEARCH
  geany.scintilla(2500, 8, 0)
  -- SCI_INDICATORCLEARRANGE
  geany.scintilla(2505, 0, iL)
end

-- Find and mark
local n1, n2 = 0, 0
local aOpt = {}
while true do
  n1, n2 = geany.find(sT, n1, iL, aOpt)
  if n1 == nil then break end
  -- SCI_SETINDICATORCURRENT ÷ GEANY_INDICATOR_SEARCH
  geany.scintilla(2500, 8, 0)
  -- SCI_INDICATORFILLRANGE
  geany.scintilla(2504, n1, n2 - n1)
  n1 = n2
end
```

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

Message ID: <geany/geany-plugins/issues/1567/[email protected]>

Reply via email to