Skif-off left a comment (geany/geany-plugins#1559)
This is fun.
I have a folder called `2-Scripting` in my `~/.geany/plugins/geanylua`
directory, which contains a file called `test-bookmarks.lua`. Its modification
date is November 2020...
About a week ago, I remembered about bookmarks again and saved this file to my
phone to study it when I'm in the mood.
Beginning of file:
```lua
-- test-bookmarks.lua
--[[
SCI_MARKERADD = 2043
SCI_MARKERDELETE = 2044
SCI_MARKERGET = 2046
SCI_MARKERNEXT = 2047
SCI_MARKERPREVIOUS = 2048
]]
-- Add bookmarks for lines 5 and 10
local s = geany.scintilla(2046, 4, 1);
if (s == 0) then geany.scintilla(2043, 4, 1) end;
local s = geany.scintilla(2046, 9, 1);
if (s == 0) then geany.scintilla(2043, 9, 1) end;
-- Get next & previous line number with bookmark
local n = geany.scintilla(2047, 0, 0x2);
local p = geany.scintilla(2048, 9, 0x2);
if geany.confirm("test-bookmarks.lua",
"Next bookmark (after 0):\t" .. n ..
"\nPrevious (before 10):\t\t" .. p ..
"\n\nDo you want to delete all bookmarks?",
true) then
local h = geany.height() - 1;
for i = 0, h, 1 do
s = geany.scintilla(2046, i, 1);
-- If bookmark is exists then del
if (s ~= 0) then geany.scintilla(2044, i, 1) end;
end
end
```
Hmm... How did you do it? :))
There is something that can be done, see the [plugin's
help](https://plugins.geany.org/geanylua/geanylua-intro.html):
> The special directory `./plugins/geanylua/events` can contain some scripts
> that will be invoked whenever the respective event is triggered by Geany.
I mean `saved.lua` & `opened.lua` (`proj-*.lua` are more complicated because a
project is usually more than one file (and I never used this feature, for
various reasons)).
In theory, regular text file can be used as a data base:
```
fullfilename1=bookmark1,bookmark2,...,bookmarkN
fullfilename2=bookmark1,bookmark2,...,bookmarkN
and so on
```
--
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany-plugins/issues/1559#issuecomment-4545640589
You are receiving this because you are subscribed to this thread.
Message ID: <geany/geany-plugins/issues/1559/[email protected]>