<p>2 changes to make a11y quite a bit faster especially when performing bulk search & replace.</p>
<p>The first commit makes use of the character offset cache when performing reverse-lookup, e.g. when we need to convert a position given by the a11y layer to one understood by Scintilla.</p>
<p>The second avoids clearing the cache when it gets invalidated, and instead updates it to be valid right away. This avoids potentially costly re-computation of the cache that becomes problematic when we often need a position near the end of the file but keep invalidating everything after lines near the start.  This happens especially when performing bulk search & replace with the cursor near the end.  This gives a slightly higher cost at invalidating the cache (that now updates it based on a known delta), but a lot less when it's content is needed again.</p>
<p><span class="issue-keyword tooltipped tooltipped-se" aria-label="This pull request closes issue #2092.">Fixes</span> <a class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="414483109" data-permission-text="Issue title is private" data-url="https://github.com/geany/geany/issues/2092" data-hovercard-type="issue" data-hovercard-url="/geany/geany/issues/2092/hovercard" href="https://github.com/geany/geany/issues/2092">#2092</a>.</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/2097'>https://github.com/geany/geany/pull/2097</a></p>

<h4>Commit Summary</h4>
<ul>
  <li>scintilla: GTK: a11y: Optimize byte to character offset conversion</li>
  <li>scintilla: GTK: a11y: Avoid clearing cache when possible</li>
</ul>

<h4>File Changes</h4>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/geany/geany/pull/2097/files#diff-0">scintilla/gtk/ScintillaGTKAccessible.cxx</a>
    (15)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/geany/geany/pull/2097/files#diff-1">scintilla/gtk/ScintillaGTKAccessible.h</a>
    (14)
  </li>
</ul>

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

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/geany/geany/pull/2097">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABDrJ53Luwruwoa5JzqAV0AUzRxnFwlxks5vS8jagaJpZM4ba-qN">mute the thread</a>.<img src="https://github.com/notifications/beacon/ABDrJ2XKNpdTIP9OxFv__4HfmdncBDGbks5vS8jagaJpZM4ba-qN.gif" height="1" width="1" alt="" /></p>
<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/geany/geany","title":"geany/geany","subtitle":"GitHub repository","main_image_url":"https://github.githubassets.com/images/email/message_cards/header.png","avatar_image_url":"https://github.githubassets.com/images/email/message_cards/avatar.png","action":{"name":"Open in GitHub","url":"https://github.com/geany/geany"}},"updates":{"snippets":[{"icon":"DESCRIPTION","message":"Scintilla: faster a11y (#2097)"}],"action":{"name":"View Pull Request","url":"https://github.com/geany/geany/pull/2097"}}}</script>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/geany/geany/pull/2097",
"url": "https://github.com/geany/geany/pull/2097",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>