Steps to reproduce 1: open a very long HTML-document, so one need to scroll 2: make the sidebar visible 3: make the width of the editor very small (for example just some centimeters), so that the sidebar has a big width 4: put the cursor at the end of the second last line 5: press 2x the shortcut "Toggle Sidebar"
Result The highlighted line is not in the visible area any more. To make it visible one need to scroll or to press the arrow keys on the keyboard.
Expectation The highlighted line and specially the blinking cursor should be exactly at the same visible position where it was just before toggling the sidebar.
Context I use the plugin Geany Preview (it is a fantastic tool for the creation of webpages - the result is shown live in the sidebar) and I wanted to use the shortcut "Toggle Sidebar" many times a day, so it disturbs every time that the highlighted line is not right away in the visible area as it was before toggling.
Remark On an other computer I installed Geany. When I don't change the size of the width of the sidebar after the installation, then everything works perfect. So it seems to be that the issue has to do something with changing size of the width of the sidebar.
System Lubuntu 22.04.1 and Lubuntu 22.10 Geany 1.38 and Geany 1.39
Can't reproduce.
Please try to reproduce with _all_ plugins disabled, in particular geany preview is not a Geany project plugin AFAIK.
Please try to reproduce with all plugins disabled, in particular geany preview is not a Geany project plugin AFAIK.
As I mentioned in the report under the title "Remark" I did a fresh installation of Geany where on that system Geany was never installed before, so without any plugins.
Well, I can't reproduce it, so somethings missing in your recipe. I used the geany manual `index.html` since everyone has it, see if it reproduces with that.
I used the geany manual index.html since everyone has it, see if it reproduces with that.
I can not reproduce it also with index.html. I will upload in some seconds my HTML-document.
Place the cursor in the HTML-text at the end just after "Put the cursor here:" ``` <!DOCTYPE html> <html> <body>
<p>this is a webpage</p> <p>
Lorem ipsum dolor sit amet, consectetur adipisici elit, sed eiusmod tempor incidunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquid ex ea commodi consequat. Quis aute iure reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint obcaecat cupiditat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Ipsum reproducum nil.
Something else you are not telling me???
PS next time put the document in a [gist](https://gist.github.com/) and just post the link, you have spammed everyone watching the repository.
PS next time put the document in a [gist](https://gist.github.com/) and just post the link, you have spammed everyone watching the repository.
Sorry.
Should I add screenshots?
Run `geany -c /tmp/geanyconfig` to get a default setup, then try to reproduce, and post whatever settings you have to change, and what you set them to.
in the terminal: geany -c /tmp/geanyconfig
1: menu-bar: Document: activate "Line wrapping" 2: change size of the width of the editor: about 10% of width of the editor and 90% width of the sidebar 3: place the cursor in the HTML-text at the end just after "Put the cursor here:" 4: menu-bar: View: deactivate Show sidebar 5: menu-bar: View: activate Show sidebar
Can you reproduce the issue?
Ahhhh, line wrapping!!!!!
Try with `Edit->Preferences->Editor->Display->Stop scrolling at last line` unset.
What is happening when you make the editor pane wider with wrapping on is the text on screen occupies less vertical space, so with that setting _on_ it has to scroll (the line at the _top_ of the screen is scroll position) to remove the blank lines past the end of the text.
Then when you narrow the pane again the scroll position is kept at the top of the screen, forcing the current line off the screen as the wrapped text occupies more vertical space again.
I'd say this is intended behaviour, otherwise the user couldn't scroll the display away from the current line and have it stay there.
Try with Edit->Preferences->Editor->Display->Stop scrolling at last line unset.
Sometimes the issue appears and sometimes not.
I'd say this is intended behaviour, ...
My expectation is (even I don't understand what is going on when toggling, and even if I don't know how the issue could be solved): The highlighted line and specially the blinking cursor should be in the visible area. The best would be that, if there is no change in the text and if there is no move of the cursor during the toggling process, then the blinking cursor should be exactly at the same place like it was before toggling.
Your mental model is incorrect, so your expectation is incorrect.
You may see a change in the width of the edit pane due to hiding of the sidebar, and then an undo of that change, but Geany and Scintilla only see a sequence of two unrelated changes, not an undo.
The fact that the the resultant width happens to be the same as the prior one is irrelevant, no record of previous widths or scroll positions is kept, so there is no way for Geany/Scintilla to detect it, nor of undoing it since there is no record of scroll positions to undo.
So if one operation causes scrolling, the other won't undo it, to maintain manual scroll positions nothing is scrolled unless some other rule (like not allowing blank space below the last line) requires it. Otherwise when the user scrolled away from the cursor position the display would not stay there.
so your expectation is incorrect.
You should not let your understanding and expectation be confused with what you __prefer__ to happen, thats something totally different :grin:.
As you said, changing it to behave as you prefer requires some way of implementing that change to be identified, and then if other users agree with the new behaviour the PR can be added (no reason they should not if nothing other than this edge case changes, I doubt anyone will be critically depending on such edge case behaviour, but if it results in changes of behaviour elsewhere there may be more robust discussions).
To the solution (to avoid misunderstanding): 1: The most important thing is that the cursor should always be in the visible area right after toggling. 2: A special case is when the cursor was not moved during toggling (then the cursor should have exactly the same position like it was before toggling 2x).
github-comments@lists.geany.org