[Github-comments] [geany/geany-plugins] GeanyLua: problem with SCI_MARKERNEXT and SCI_MARKERPREVIOUS (#706)

Skif-off notifications at xxxxx
Sat Feb 24 15:04:42 UTC 2018


These messages don't work, return -1 in any case. Script-example:
```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, 1);
local p = geany.scintilla(2048, 9, 1);
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
```
What could be the problem? (I tried Geany 1.32 on Xubuntu 17.10 x64 and Geany 1.33-git on Win7x32.)

P.S. Yes, I can use the numeric ```for``` statement, but it's required send minimum one message to Scintilla for _every_ line.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany-plugins/issues/706
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20180224/9d3c59b1/attachment.html>


More information about the Github-comments mailing list