Smart home should also move the text view smartly
Affected version
- Nightly flatpak: Yes
- Other: Fedora 36, Builder (Flatpak) v43.4
Steps to reproduce
- Write an indented text line, longer than the window width
- Press
End
- You shouldn’t see the start of the line anymore, because the view is on the very right with the left side cut off.
- Press
Home
Current behavior
You get to the smart home position, with the text view starting e.g. at column 4.
But you don’t see columns 0-3, which is unfortunate because the context gets cut off by usually just some very few columns.
Because of this, I guess I’m not the only one who always afterwards manually corrects the view position by e.g. pressing Home
another two times or likewise.
Expected behavior
-
If the text is not too much indented (so nothing like deeply nested HTML code) it makes sense to move the view to the very first column, so that columns like 0-3 don’t get hidden. The cursor then risides in column 4.
-
According to behavior 1: If the text in contrast is strongly indented, the cursor gets positioned more and more to the right side of the view, the deeper the nesting goes. At some point this gets contraproductive, as the horizontal jump will get too large. I think it’s good to hold on to behavior 1 (move the view to the complete left) for as long as the cursor gets positioned on the left half side of the text view. If the indentation is even deeper, I propose to position the view so that it’s centered around the cursor / start of line.
Additional information
I already asked for this about 5 or 6 years ago, and it got implemented in GTK3-Builder. Sadly, I wasn’t able to find my old issue, guess it was in the old bugzilla.