Dov Feldstern wrote:
Stefan Schimanski wrote:
I think this version of the patch is ready to commit. I have tested it
on many examples and think the behavior is as it should be (up to some
minor points which can and should be addressed later). Below you find
some explanation of what the patch does and these issues. If you
haven't tried it out, please do so and send a answer here, I don't
feel good to commit it if I am the only one who tried it, and then RC1
is broken because of that.
Hmmm... there are some minor changes in the behavior of LyX due to your
patches. For example, in a paragraph which spans multiple lines: if you
move back (left in LTR) from the first position in the line, you used to
be placed immediately after the last letter on the previous line. Now,
you are placed one space after that. Going in the other direction,
though, that space "doesn't exist": you move immediately from after the
last letter to the new line. So going across that boundary, you can move
one space forward and two spaces backwards and get back to the same
place. I think the old behavior (where that space doesn't exist in
either direction) makes more sense (because just like any other space,
you need *one* cursor movement to get from just before the first letter
in the second word to just after the last letter in the first word, and
vice versa).
I don't know that this really matters very much, but something is a
little off...
Dov
The attached patch solves this problem. But I still don't understand how
this is all supposed to work. Given the attached patch, why is the
boundary necessary at all between lines? (It is: just getting rid of the
whole if statement which begins with !cur.boundary() causes a crash. It
seems to me like maybe the boundary business somehow "prepares" the move
across lines, by setting the new line's metrics or something, without
actually moving?!)
So I really have no idea how this works, but the attached does solve one
problem. I don't know if it creates new ones, though --- haven't run
into any yet...
Index: lyx-devel/src/Text2.cpp
===================================================================
--- lyx-devel.orig/src/Text2.cpp 2007-05-27 23:05:41.000000000 +0300
+++ lyx-devel/src/Text2.cpp 2007-05-27 22:58:43.000000000 +0300
@@ -991,7 +991,7 @@
cur.textRow().pos() == cur.pos() &&
!cur.paragraph().isLineSeparator(cur.pos()) &&
!cur.paragraph().isNewline(cur.pos())) {
- return setCursor(cur, cur.pit(), cur.pos(), true, true);
+ return setCursor(cur, cur.pit(), cur.pos() - 1, true,
true);
}
// go left and try to enter inset
@@ -1018,7 +1018,7 @@
if (cur.pos() != cur.lastpos()) {
// if left of boundary -> just jump to right side
if (cur.boundary())
- return setCursor(cur, cur.pit(), cur.pos(), true,
false);
+ return setCursor(cur, cur.pit(), cur.pos() + 1, true,
false);
// in front of editable inset, i.e. jump into it?
if (checkAndActivateInset(cur, true))