]> git.lyx.org Git - lyx.git/commit
Cleanup Page Up/Down code
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Wed, 4 Sep 2024 13:48:38 +0000 (15:48 +0200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 5 Sep 2024 14:57:35 +0000 (16:57 +0200)
commit9c443d965114318dacbb67db68f5a3fd9b1b8fc2
treeec1a26ef0a3c17515dcb6a49d6efa7cbc5badeef
parent439b7bb9c97ba2f267a4ccc9ae3d9af5eab100f9
Cleanup Page Up/Down code

Since BufferView::scroll() does not correct scrolling amount at
top/bottom anymore, remove its return value and add a new one to
BufferView::updateMetrics(bool) that returns this correction.

Rely on updateMetrics(false) to set the metrics straight after moving
the anchor y position.

Use assert_in_view = false when calling TextMetrics::editXY() because
this parameter does not work as advertised: if an inset not totally
visible, the code will not try to go inside it to look for a smaller
row that is totally visible.

Two small (hopfully useful) modifications:
- take into account the cursor X target instead of its screen position
- adapt the cursor position depending on
  lyxrc.mac_like_cursor_movement when hitting start or end of
  document.
src/BufferView.cpp
src/BufferView.h