Steps to reproduce: 1. Open document `foo.bar` in Geany. 2. Open the same document in e.g. `vi` and modify it. 3. Click inside the Scintilla widget inside Geany containing `foo.bar` 4. This single click selects several lines of code.
The selection below is a result of a single click: <img width="1005" alt="Screenshot 2024-06-13 at 16 02 18" src="https://github.com/geany/geany/assets/713965/89e45dd2-c49b-4ba8-945e-b62d5019f1c9">
What I think happens is that when the widget with the warning appears at the top of the window, Scintilla scrolls the text by the amount of the height of the widget and all this happens within the click handler. As the scroll happens while the click is in progress, selection is made between the start Scintilla position of the click and the end position after the scroll.
Maybe postponing the display with the warning to idle would help here.
Version of Geany and platform (and in your case if thats a VM)?
Cannot reproduce with:
``` 09:41:52: Geany INFO : Geany 2.1 (git >= 8ca4170b1), en_AU.UTF-8 09:41:52: Geany INFO : GTK 3.24.20, GLib 2.64.6 09:41:52: Geany INFO : OS: Linux Mint 20 (ulyana) ```
Are you sure you are trying to reproduce it correctly?
Maybe I didn't describe the reproduction steps in enough details - in (2) you have to switch to another window (e.g. terminal containing`vi`) and after you modify the document there, the click inside Geany's editor must be the one by which Geany gains focus (i.e. do not first click in Geany's title bar to get it in the foreground and then inside Scintilla).
the click inside Geany's editor must be the one by which Geany gains focus (i.e. do not first click in Geany's title bar to get it in the foreground and then inside Scintilla).
Ok, thats the information that was missing, I normally have "focus follows mouse" which made it impossible to click in Geany before it had the focus. Can reproduce.
I was bitten by this a couple of times as well. Fix works, thanks @techee!
Closed #3906 as completed via #3909.
Closed #3906 as completed via abbe1c984f6da1f1a1fa89851b9d010e5d3a19ae.
github-comments@lists.geany.org