Was the intention that when there is a long line followed by a short
line, followed by a long line and you press down twice, starting
torwards the end of the first long line, then you wanted to the cursor
to be torwards the end of the second long line?
eg. start at s, press down twice, land at e (instead of x)
0000000000000000000000000000000000000000s000
1111111111111111111111111111
2222222222222222222222222222x22222222222e2222
Yes, exactly that. And I realise now that the test is still needed for
that but as you found out has probably some side effects, especially in
tables.
If you can think of a cleverer solution, fine with me.
I would suggest this path then. Even then there is still some not so fine behavior, but i think we
should discuss that after beta3 (when i have a little bit time for that).
Bernhard
Index: src/Text2.cpp
===================================================================
--- src/Text2.cpp (revision 18288)
+++ src/Text2.cpp (working copy)
@@ -991,10 +991,10 @@
else
row = pm.pos2row(cur.pos());
- // remember current position only if we are not at the end of a row.
- if (cur.pos() != pm.rows()[row].endpos())
- cur.setTargetX();
- int const x = cur.targetX();
+ int x = cur.targetX();
+ cur.setTargetX();
+ if (cur.pos() != pm.rows()[row].endpos() || x < cur.targetX())
+ x = cur.targetX();
if (!cur.selection()) {
int const y = bv_funcs::getPos(cur.bv(), cur,
cur.boundary()).y_;
@@ -1050,10 +1050,10 @@
else
row = pm.pos2row(cur.pos());
- // remember current position only if we are not at the end of a row.
- if (cur.pos() != pm.rows()[row].endpos())
- cur.setTargetX();
- int const x = cur.targetX();
+ int x = cur.targetX();
+ cur.setTargetX();
+ if (cur.pos() != pm.rows()[row].endpos() || x < cur.targetX())
+ x = cur.targetX();
if (!cur.selection()) {
int const y = bv_funcs::getPos(cur.bv(), cur,
cur.boundary()).y_;