]> git.lyx.org Git - features.git/commitdiff
Handle properly top/bottom of inset with mac-like cursor movement
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Sat, 15 Jul 2017 15:23:22 +0000 (17:23 +0200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Wed, 14 Feb 2018 16:06:03 +0000 (17:06 +0100)
The correct behavior is to go to position 0 going up from first row,
and to end of row when going down on last row.

The targetx value of the cursor is not updated, which makes cursor
movement more natural.

Fixes bug #10701.

(cherry picked from commit 34285cc6830b061c18998bff8385092a311170a8)

src/Text3.cpp
status.23x [new file with mode: 0644]

index 36739a8e1e21c732226dd15b5afb85c25d1c2125..adeb80b88f15ec737c699a0d305d6cd71683f8b2 100644 (file)
@@ -860,6 +860,18 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
                        cur.upDownInText(up, needsUpdate);
                        needsUpdate |= cur.beforeDispatchCursor().inMathed();
                } else {
+                       pos_type newpos = up ? 0 : cur.lastpos();
+                       if (lyxrc.mac_like_cursor_movement && cur.pos() != newpos) {
+                               needsUpdate |= cur.selHandle(select);
+                               // we do not reset the targetx of the cursor
+                               cur.pos() = newpos;
+                               needsUpdate |= bv->checkDepm(cur, bv->cursor());
+                               cur.updateTextTargetOffset();
+                               if (needsUpdate)
+                                       cur.forceBufferUpdate();
+                               break;
+                       }
+
                        // if the cursor cannot be moved up or down do not remove
                        // the selection right now, but wait for the next dispatch.
                        if (select)
diff --git a/status.23x b/status.23x
new file mode 100644 (file)
index 0000000..30eff6c
--- /dev/null
@@ -0,0 +1,68 @@
+-*- text -*-
+
+This file describes what has been done in the preparation of LyX 2.3.2.
+All comments are welcome.
+
+We try to group things by topic and in decreasing order of importance.
+Please feel free to re-arrange if that seems like a good idea.
+
+
+What's new
+==========
+
+** Updates:
+***********
+
+* DOCUMENT INPUT/OUTPUT
+
+
+
+* TEX2LYX IMPROVEMENTS
+
+
+
+* USER INTERFACE
+
+- Handle properly top/bottom of inset with mac-like cursor movement
+  (bug 10701).
+
+* DOCUMENTATION AND LOCALIZATION
+
+
+
+* BUILD/INSTALLATION
+
+
+** Bug fixes:
+*************
+
+* DOCUMENT INPUT/OUTPUT
+
+
+* LYX2LYX
+
+
+* USER INTERFACE
+
+
+
+* INTERNALS
+
+
+
+* DOCUMENTATION AND LOCALIZATION
+
+
+* LYXHTML
+
+
+
+* TEX2LYX
+
+
+
+* ADVANCED FIND AND REPLACE
+
+
+* BUILD/INSTALLATION
+