Le 21/09/2013 09:52, Hashini Senaratne a écrit :
Next I will try to focus on the problems having with table inset.
  *When moving inside a table and adding and deleting text at a scrolled
state, the text cursor is not overlapping with the actual typing position.

According to my testing so far, it is something to do with the cursor
positions within the table cells.

Hello Hashini,

I think the problem is just SingleParUpdate vs FullScreenUpdate. Try the attached patch.

JMarc



>From d396cb8b6a7bd4dcdd2e76632b79359044da111d Mon Sep 17 00:00:00 2001
From: Jean-Marc Lasgouttes <lasgout...@lyx.org>
Date: Wed, 25 Sep 2013 10:49:20 +0200
Subject: [PATCH] Fix problem with tabular inset when the old-style scrolling
 is disabled

The problem is actually more general than just inset tabular. For some reason
the inset positions are not correct when using SingleParUpdate, but we do
not yet know why.
---
 src/BufferView.cpp          | 13 +++++++++----
 src/insets/InsetTabular.cpp |  2 ++
 2 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/src/BufferView.cpp b/src/BufferView.cpp
index 7f4e499..3e79c09 100644
--- a/src/BufferView.cpp
+++ b/src/BufferView.cpp
@@ -2893,11 +2893,16 @@ void checkCursorLeftEdge(PainterInfo & pi, Cursor const & cur,
 		row_moved = true;
 	}
 
-	if (strategy == NoScreenUpdate 
+	if ((strategy == NoScreenUpdate || strategy == SingleParUpdate)
 		&& (row_moved || !cur.getPreviousRowSlice().empty())) {
-		// FIXME: if one uses SingleParUpdate, then home/end
-		// will not work on long rows. Why?
-		strategy = FullScreenUpdate;//DecorationUpdate;//FullScreenUpdate;
+		/**  FIXME: if one uses SingleParUpdate, then metrics
+		 * are wrong for long rows. This is visible with
+		 * home/end or navigation in wide tables. However the
+		 * reason for that is not yet clear. To work around
+		 * this problem, we enforce FullScreenUpdate, although
+		 * we would like to use SingleParUpdate.
+		*/
+		strategy = FullScreenUpdate;
 	}
 
 	cur.setLeftEdge(left_edge);
diff --git a/src/insets/InsetTabular.cpp b/src/insets/InsetTabular.cpp
index 5571de0..b8b3335 100644
--- a/src/insets/InsetTabular.cpp
+++ b/src/insets/InsetTabular.cpp
@@ -5136,6 +5136,7 @@ int InsetTabular::cellXPos(idx_type const cell) const
 
 void InsetTabular::resetPos(Cursor & cur) const
 {
+#if 0
 	BufferView & bv = cur.bv();
 	int const maxwidth = bv.workWidth();
 
@@ -5161,6 +5162,7 @@ void InsetTabular::resetPos(Cursor & cur) const
 	// only update if offset changed
 	if (scx_ != scx_old)
 		cur.screenUpdateFlags(Update::Force | Update::FitCursor);
+#endif
 }
 
 
-- 
1.8.1.2

Reply via email to