@elextr I’m [trying out](https://github.com/vfaronov/geany/commit/ff1f28d8295e785abea27033d48c1e40d06...) 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.
So, in cases like replace-all, Scintilla does all the work for me.
I 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.
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.
Also, I lose navqueue items whenever the document is reloaded.