<p><a href="https://github.com/elextr" class="user-mention">@elextr</a> I’m <a href="https://github.com/vfaronov/geany/commit/ff1f28d8295e785abea27033d48c1e40d064373f">trying out</a> an approach based on Scintilla indicators. Instead of storing the actual position in the navqueue, I store a unique ID, and then fill that position with a special, hidden indicator with <a href="http://www.scintilla.org/ScintillaDoc.html#SCI_SETINDICATORVALUE">its value set</a> to the same ID. To go to another queue item, I iterate over all ranges of this indicator in the document, until I get the range with the necessary ID.</p>
<p>So, in cases like replace-all, Scintilla does all the work for me.</p>
<p>I don’t even think this is too much of a hack. That indicator could reasonably be shown with <a href="http://www.scintilla.org/ScintillaDoc.html#SCI_INDICSETSTYLE"><code>INDIC_POINT</code></a> style, it would look like a trail of breadcrumbs.</p>
<p>I will probably need to limit the navqueue to some reasonable maximum length, so I don’t accumulate too many ranges that must be walked every time.</p>
<p>Also, I lose navqueue items whenever the document is reloaded.</p>

<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/issues/1480#issuecomment-297057587">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABDrJyfdGQlzuEwZb5Oa8Hz4Yytd4mg3ks5rzgnlgaJpZM4NHIsC">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/ABDrJz_qOvtOjPiiFURNLo-_y5pres_Nks5rzgnlgaJpZM4NHIsC.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/issues/1480#issuecomment-297057587"></link>
  <meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>

<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://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/geany/geany"}},"updates":{"snippets":[{"icon":"PERSON","message":"@vfaronov in #1480: @elextr I’m [trying out](https://github.com/vfaronov/geany/commit/ff1f28d8295e785abea27033d48c1e40d064373f) an approach based on Scintilla indicators. Instead of storing the actual position in the navqueue, I store a unique ID, and then fill that position with a special, hidden indicator with [its value set](http://www.scintilla.org/ScintillaDoc.html#SCI_SETINDICATORVALUE) to the same ID. To go to another queue item, I iterate over all ranges of this indicator in the document, until I get the range with the necessary ID.\r\n\r\nSo, in cases like replace-all, Scintilla does all the work for me.\r\n\r\nI don’t even think this is too much of a hack. That indicator could reasonably be shown with [`INDIC_POINT`](http://www.scintilla.org/ScintillaDoc.html#SCI_INDICSETSTYLE) style, it would look like a trail of breadcrumbs.\r\n\r\nI will probably need to limit the navqueue to some reasonable maximum length, so I don’t accumulate too many ranges that must be walked every time.\r\n\r\nAlso, I lose navqueue items whenever the document is reloaded."}],"action":{"name":"View Issue","url":"https://github.com/geany/geany/issues/1480#issuecomment-297057587"}}}</script>