Dov Feldstern wrote:
Dov Feldstern wrote:
Andre Poenitz wrote:
On Fri, Apr 04, 2008 at 12:15:24PM +0300, Dov Feldstern wrote:
[something unrelated ;-)]

Hi Dov.

Since you are around: I have a suspicion tha change  22930
removed the possibility do extend a selection in mathed
using Shift+Left/Right outside the current cell.

This was possible at some point of time, and still works out side math.

I wouldn't mind if you could have a look...

Andre'

Hi, Andre'!

Yes, I see the problem, I'll try to take a look at it tonight.
Thanks for the heads-up!

Dov

Hmmm, I can confirm that my change introduced the problem. I'll see what I can do about it...


Hi, Andre'!

OK, I have a fix for this issue, attached.

1) Is there an open bug in bugzilla for this issue (just so that I can write it in the commit log)?

2) Do you understand why this works? For the life of me, I can't figure it out: it seems to me that I had been preserving the original behavior, which only the current fix is now breaking:

In the old code (i.e., 22929), we would have reached http://www.lyx.org/trac/browser/lyx-devel/trunk/src/mathed/InsetMathNest.cpp?rev=22929#L513, cur.selection() would be true, and therefore we would *not* dispatch LFUN_FINISHED_FORWARD.

So, in 22930 I tried to keep that behavior: we would reach http://www.lyx.org/trac/browser/lyx-devel/trunk/src/mathed/InsetMathNest.cpp?rev=22930#L559, enter cursorMathForward, and at http://www.lyx.org/trac/browser/lyx-devel/trunk/src/mathed/InsetMathNest.cpp?rev=22930#L1597 cur.selection() would again be true, we would return true, and therefore again *not* dispatch lfun_finish (back at http://www.lyx.org/trac/browser/lyx-devel/trunk/src/mathed/InsetMathNest.cpp?rev=22930#L562).

Now, with the fix, I'm changing that. Did I just get mixed up with a De Morgan or something?

Thanks!
Dov
diff -r 034d677c3be2 src/mathed/InsetMathNest.cpp
--- a/src/mathed/InsetMathNest.cpp      Sun Feb 10 19:57:00 2008 +0000
+++ b/src/mathed/InsetMathNest.cpp      Sun Apr 06 20:41:23 2008 +0300
@@ -1594,7 +1594,7 @@
                cur.inset().idxFirst(cur);
                return true;
        } 
-       if (cur.posForward() || idxForward(cur) || cur.selection())
+       if (cur.posForward() || idxForward(cur))
                return true;
        // try to pop forwards --- but don't pop out of math! leave that to
        // the FINISH lfuns
@@ -1613,7 +1613,7 @@
                cur.inset().idxLast(cur);
                return true;
        } 
-       if (cur.posBackward() || idxBackward(cur) || cur.selection())
+       if (cur.posBackward() || idxBackward(cur))
                return true;
        // try to pop backwards --- but don't pop out of math! leave that to 
        // the FINISH lfuns

Reply via email to