StefanStefan, I guess you're right --- I like comments, so I do tend to be wordy...Find attached a revised patch (cursor_left_2.diff) with a one-line comment
Much better :)
(I don't want to get rid of it altogether).However, I'm in favor of cursor_left_1.diff --- that solves the question of whether or not to comment... ;)
Either is ok.
And shorter code is even better than self-documenting code...
Well, short+self-documenting might be good. Shorter alone reminds me of perl, short code, but write-once-read-never.
Stefan
Dov Index: src/Text2.cpp =================================================================== --- src/Text2.cpp (revision 18497) +++ src/Text2.cpp (working copy) @@ -954,8 +954,6 @@ { if (cur.selection()) return false; - if (cur.pos() == cur.lastpos()) - return false; Inset * inset = front ? cur.nextInset() : cur.prevInset(); if (!isHighlyEditableInset(inset)) return false; Index: src/Text2.cpp =================================================================== --- src/Text2.cpp (revision 18504) +++ src/Text2.cpp (working copy) @@ -954,7 +954,8 @@ { if (cur.selection()) return false; - if (cur.pos() == cur.lastpos())+ // No inset to enter if we're moving forward at the end of a paragraph+ if (cur.pos() == cur.lastpos() && front) return false; Inset * inset = front ? cur.nextInset() : cur.prevInset(); if (!isHighlyEditableInset(inset))
PGP.sig
Description: Signierter Teil der Nachricht