[Geany-devel] Problem with setting position in document after reloading
techet at xxxxx
Fri Jul 9 23:57:27 UTC 2010
there's one annoying bug I'm experiencing with geany. These are the
steps to reproduce it:
1. Open a file and scroll down a bit.
2. Open the file again e.g. by double clicking the filename in the
file browser plugin.
3. Click somewhere in the editor.
What happens is that the editor moves down by several lines and
selects the text in between what was the position of the cursor before
and the position of the cursor after the movement.
I have bisected the commit that causes the problem with git and it was
introduced by the following commit:
Apply patch from Thomas Martitz to improve sidebar type-ahead code:
Use gtk_notebook_set_current_page() instead of
document_open_file_full() when choosing an item from the documents
Avoid using goto in document_open_file_full().
(+ friend commits 4158 that fixes geany crash and 4197 that prevents
the cursor from moving to the beginning of the file when reloading)
Any idea what might be the problem? Sorry for not providing a patch
that fixes it but I thought that someone might know better what's
wrong (I actually don't even know the purpose of the patch).
There's one more problem related to wrong cursor position. After
updating to Scintilla 2.12 (also bisected) when a file is opened from
a message window at certain line (e.g. by clicking at ./foo.c:80:
resulting from find in files) the document position is different when
the file is loaded for the first time (the first click in the message
window) from the position when the document is reloaded for the second
time (the second click in the message window). This is possibly just a
Scintilla 2.12 bug but might be also related to the above bug (why
does the editor behave differently when the document is opened for the
first time from the case when it's (re)opened for the second time?).
Also it happened to me several times that when I opened a file by
clicking a result of FIF in the message window, the found line was
below the current viewport. I haven't encountered this recently so
maybe it has been fixed in the meantime, just reporting it for
More information about the Devel