[Github-comments] [geany/geany] Crash after update to Scintilla 5.1.5 (Issue #3095)

elextr notifications at xxxxx
Wed Jan 12 23:20:36 UTC 2022


> > AFAICT plugins really should not be jumping into scintilla directly, is it really exposed in the API?

> It is, wrappers cover only the most essential functionality but when you need something more special, you have to use the Scintilla API directly. I use it in the vimode plugin this way and in fact only use Scnitilla because mixing wrappers and scintilla looked strange in the code.

Maybe the wrappers need expanding, I know Geany mixes it too, but we have (possibly re-)learned a lesson, the wrappers are more than convenience, they allow hiding changes to Scintilla APIs.  I don't think we should rush in and change Geany or vimode, but progressively over time move that way and put a note in HACKING and plugin API docs to that effect.

Geany has 182 uses of SSM outside `sci_wrappers.c` 91 in editor.c, 76 in highlighting.c, and the other 15 scattered about.  I bet a few strategic wrappers would get rid of the majority leaving only specialised functions accessing Scintilla directly.

> The crash is just a bad bug introduced by me.

Oh well, it happens.

And it has been useful in exposing a fragility of our API mechanism.  

Specifically that we can't handle changes to the behaviour of existing functions, and need to introduce new names if the behaviour changes (as sci_wrappers did changing `sci_get_selected_text()` to `sci_get_selection_contents()`).  And if the old function cannot be changed to remain backward compatible then it should be removed, then the recompile with an ABI change will also fail.

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

Message ID: <geany/geany/issues/3095/1011540617 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20220112/ceaa70aa/attachment.htm>


More information about the Github-comments mailing list