<p>Aside from passing the <code>GeanyDocument</code> instead of the <code>ScintillaObject</code>, and getting to the <code>sci</code> pointer through <code>doc->editor->sci</code> or whatever, there's also a (non public) function <a href="https://github.com/geany/geany/blob/master/src/document.h#L244">document_find_by_sci</a> that could be used to find the document for the scintilla widget (if it was in plugin API).</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br>Reply to this email directly or <a href="https://github.com/geany/geany-plugins/issues/301#issuecomment-155260365">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/ABDrJ8-TjLPXpqYDPGQYn5TtViCilR7eks5pEUjugaJpZM4Ge1A-.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/geany/geany-plugins/issues/301#issuecomment-155260365"></link>
  <meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>