Jean-Marc Lasgouttes wrote:
> The test is bogus, you should pass true to selHandle, or merge
> LFUN_ENDBUFSEL and LFUN_ENDBUF.

true, I justed missed the rationale of the test. The attached is better, of 
course.

> Juergen> This patch also fixes bug 2119 (Selection of text via
> Juergen> keyboard sometimes fails) and bug 2259 (screen-up/down-select
> Juergen> do not work).
>
> Juergen> Too late for 1.4.2?
>
> Not necessarily, it is kind of obvious. 

Given that it fixes 3 bugs, one of it critical, another pretty annoying, it 
would be nice to have.

> This needs testing.

I tested it, so I need volunteers now.

Jürgen


Index: src/ChangeLog
===================================================================
--- src/ChangeLog	(Revision 14429)
+++ src/ChangeLog	(Arbeitskopie)
@@ -1,3 +1,8 @@
+2006-07-12  Jürgen Spitzmüller  <[EMAIL PROTECTED]>
+
+	* text3.C (dispatch): use selHandle instead of just resetting
+	the anchor in the *SEL lfuns (fixes bugs 2683, 2119 and 2259).
+
 2006-07-07  Jean-Marc Lasgouttes  <[EMAIL PROTECTED]>
 
 	* rowpainter.h (rightMargin): reduce to 10 pixels, like the left
Index: src/text3.C
===================================================================
--- src/text3.C	(Revision 14429)
+++ src/text3.C	(Arbeitskopie)
@@ -396,8 +396,7 @@ void LyXText::dispatch(LCursor & cur, Fu
 
 	case LFUN_BEGINNINGBUFSEL:
 		if (cur.depth() == 1) {
-			if (!cur.selection())
-				cur.resetAnchor();
+			cur.selHandle(true);
 			needsUpdate = cursorTop(cur);
 			finishChange(cur, true);
 		} else {
@@ -418,8 +417,7 @@ void LyXText::dispatch(LCursor & cur, Fu
 
 	case LFUN_ENDBUFSEL:
 		if (cur.depth() == 1) {
-			if (!cur.selection())
-				cur.resetAnchor();
+			cur.selHandle(true);
 			needsUpdate = cursorBottom(cur);
 			finishChange(cur, true);
 		} else {
@@ -496,8 +494,7 @@ void LyXText::dispatch(LCursor & cur, Fu
 		break;
 
 	case LFUN_UP_PARAGRAPHSEL:
-		if (!cur.selection())
-			cur.resetAnchor();
+		cur.selHandle(true);
 		cursorUpParagraph(cur);
 		finishChange(cur, true);
 		break;
@@ -510,47 +507,41 @@ void LyXText::dispatch(LCursor & cur, Fu
 		break;
 
 	case LFUN_DOWN_PARAGRAPHSEL:
-		if (!cur.selection())
-			cur.resetAnchor();
+		cur.selHandle(true);
 		cursorDownParagraph(cur);
 		finishChange(cur, true);
 		break;
 
 	case LFUN_PRIORSEL:
 		update(cur);
-		if (!cur.selection())
-			cur.resetAnchor();
+		cur.selHandle(true);
 		needsUpdate = cursorPrevious(cur);
 		finishChange(cur, true);
 		break;
 
 	case LFUN_NEXTSEL:
 		update(cur);
-		if (!cur.selection())
-			cur.resetAnchor();
+		cur.selHandle(true);
 		needsUpdate = cursorNext(cur);
 		finishChange(cur, true);
 		break;
 
 	case LFUN_HOMESEL:
 		update(cur);
-		if (!cur.selection())
-			cur.resetAnchor();
+		cur.selHandle(true);
 		needsUpdate = cursorHome(cur);
 		finishChange(cur, true);
 		break;
 
 	case LFUN_ENDSEL:
 		update(cur);
-		if (!cur.selection())
-			cur.resetAnchor();
+		cur.selHandle(true);
 		needsUpdate = cursorEnd(cur);
 		finishChange(cur, true);
 		break;
 
 	case LFUN_WORDRIGHTSEL:
-		if (!cur.selection())
-			cur.resetAnchor();
+		cur.selHandle(true);
 		if (isRTL(cur.paragraph()))
 			cursorLeftOneWord(cur);
 		else
@@ -559,8 +550,7 @@ void LyXText::dispatch(LCursor & cur, Fu
 		break;
 
 	case LFUN_WORDLEFTSEL:
-		if (!cur.selection())
-			cur.resetAnchor();
+		cur.selHandle(true);
 		if (isRTL(cur.paragraph()))
 			cursorRightOneWord(cur);
 		else

Reply via email to