<p></p>
<blockquote>
<blockquote>
<p dir="auto">AFAICT plugins really should not be jumping into scintilla directly, is it really exposed in the API?</p>
</blockquote>
</blockquote>
<blockquote>
<p dir="auto">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.</p>
</blockquote>
<p dir="auto">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.</p>
<p dir="auto">Geany has 182 uses of SSM outside <code>sci_wrappers.c</code> 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.</p>
<blockquote>
<p dir="auto">The crash is just a bad bug introduced by me.</p>
</blockquote>
<p dir="auto">Oh well, it happens.</p>
<p dir="auto">And it has been useful in exposing a fragility of our API mechanism.</p>
<p dir="auto">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 <code>sci_get_selected_text()</code> to <code>sci_get_selection_contents()</code>).  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.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/geany/geany/issues/3095#issuecomment-1011540617">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAIOWJ5WP25NT6FFGD4UJF3UVYEEJANCNFSM5LV3I2KA">unsubscribe</a>.<br />Triage notifications on the go with GitHub Mobile for <a href="https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675">iOS</a> or <a href="https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub">Android</a>.
<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAIOWJY2UMPKHZGDB3KZ7LTUVYEEJA5CNFSM5LV3I2KKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOHRFOFCI.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span><geany/geany/issues/3095/1011540617</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/geany/geany/issues/3095#issuecomment-1011540617",
"url": "https://github.com/geany/geany/issues/3095#issuecomment-1011540617",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>