<p dir="auto">This commit fixes a few problems introduced by the last Scintilla update.<br>
That update caused some headache around the incompatible changes to<br>
<code>SCI_GETTEXT</code>, <code>SCI_GETSELTEXT</code>, and <code>SCI_GETCURLINE</code>.</p>
<ul dir="auto">
<li>
<p dir="auto">An explicit NUL termination was added to <code>sci_get_text()</code>. This is both<br>
superflous and wrong (it writes behind the allocated buffer) as SCI_GETTEXT<br>
already does NUL termination.</p>
</li>
<li>
<p dir="auto">In <code>sci_get_contents()</code>, sci_get_string() cannot be used. That would call<br>
SCI_GETTEXT with length == 0 which is not the desired outcome. Instead,<br>
basically revert to the old implementation but account for the API change.</p>
</li>
<li>
<p dir="auto">The callers of sci_get_selected_text_length() must be adapted, this<br>
was missing yet. sci_get_selected_text_length() return value does not<br>
include the NUL termination anymore.</p>
</li>
</ul>
<p dir="auto"><span class="issue-keyword tooltipped tooltipped-se" aria-label="This pull request closes issue #3095.">Resolves</span> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1098931196" data-permission-text="Title is private" data-url="https://github.com/geany/geany/issues/3095" data-hovercard-type="issue" data-hovercard-url="/geany/geany/issues/3095/hovercard" href="https://github.com/geany/geany/issues/3095">#3095</a></p>
<p dir="auto">Fixes: <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/geany/geany/commit/d7c985e47412f8a53c5a8202a0f8b669c4fd5e08/hovercard" href="https://github.com/geany/geany/commit/d7c985e47412f8a53c5a8202a0f8b669c4fd5e08"><tt>d7c985e</tt></a> ("Adapt to SCI_GETTEXT changes")</p>

<hr>

<h4>You can view, comment on, or merge this pull request online at:</h4>
<p>  <a href='https://github.com/geany/geany/pull/3098'>https://github.com/geany/geany/pull/3098</a></p>

<h4>Commit Summary</h4>
<ul>
  <li><a href="https://github.com/geany/geany/pull/3098/commits/e730801308a4443cf4860efc7a57aa143a4200bd" class="commit-link">e730801</a>  Scintilla 5.1.5 aftermath</li>
</ul>

<h4 style="display: inline-block">File Changes </h4> <p style="display: inline-block">(<a href="https://github.com/geany/geany/pull/3098/files">2 files</a>)</p>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/geany/geany/pull/3098/files#diff-cf7e999119814341b59fd3b5a53ecc46271cb20152349ae0a494e77958d2d5f6">src/sciwrappers.c</a>
    (20)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/geany/geany/pull/3098/files#diff-8396dc9c2232193e29aaeddbcf7fa02add25c3c2b855f56c3e5307dc34fcfcf3">src/ui_utils.c</a>
    (4)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/geany/geany/pull/3098.patch'>https://github.com/geany/geany/pull/3098.patch</a></li>
  <li><a href='https://github.com/geany/geany/pull/3098.diff'>https://github.com/geany/geany/pull/3098.diff</a></li>
</ul>

<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/pull/3098">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAIOWJ7QHRMR2PERUEQJMWLUVSRKXANCNFSM5LXNFRJQ">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/AAIOWJ5N3YV7FGB53TFRBMTUVSRKXA5CNFSM5LXNFRJ2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4QMLLJPQ.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/pull/3098</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/pull/3098",
"url": "https://github.com/geany/geany/pull/3098",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>