[LyX/master] Let Tab go out of inset when no cycling is possible
Jean-Marc Lasgouttes
lasgouttes at lyx.org
Thu Oct 21 20:19:53 UTC 2021
commit 85f030a03173252dbb9d3ba75853ad48f43a8a8f
Author: Jean-Marc Lasgouttes <lasgouttes at lyx.org>
Date: Thu Oct 21 22:36:29 2021 +0200
Let Tab go out of inset when no cycling is possible
Adapted patch from Enrico by adding S-Tab handling.
Fixes bug #11085
---
src/mathed/InsetMathNest.cpp | 16 ++++++++++++----
1 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/src/mathed/InsetMathNest.cpp b/src/mathed/InsetMathNest.cpp
index 7e763b7..b62505a 100644
--- a/src/mathed/InsetMathNest.cpp
+++ b/src/mathed/InsetMathNest.cpp
@@ -780,8 +780,12 @@ void InsetMathNest::doDispatch(Cursor & cur, FuncRequest & cmd)
cur.clearTargetX();
cur.macroModeClose();
if (!cur.inset().idxNext(cur)) {
- cur.idx() = firstIdx();
- cur.pos() = 0;
+ if (cur.lastidx() == 0)
+ cur.popForward();
+ else {
+ cur.idx() = firstIdx();
+ cur.pos() = 0;
+ }
}
break;
@@ -791,8 +795,12 @@ void InsetMathNest::doDispatch(Cursor & cur, FuncRequest & cmd)
cur.clearTargetX();
cur.macroModeClose();
if (!cur.inset().idxPrev(cur)) {
- cur.idx() = cur.lastidx();
- cur.pos() = lyxrc.mac_like_cursor_movement ? cur.lastpos() : 0;
+ if (cur.lastidx() == 0)
+ cur.popBackward();
+ else {
+ cur.idx() = cur.lastidx();
+ cur.pos() = lyxrc.mac_like_cursor_movement ? cur.lastpos() : 0;
+ }
}
break;
More information about the lyx-cvs
mailing list