Abdelrazak Younes wrote:
> Richard Heck wrote:
>> Abdelrazak Younes wrote:
>>> 3144     text style ignored in many cases
Patch for 3144 attached.

Richard


-- 
==================================================================
Richard G Heck, Jr
Professor of Philosophy
Brown University
http://frege.brown.edu/heck/
==================================================================
Get my public key from http://sks.keyserver.penguin.de
Hash: 0x1DE91F1E66FFBDEC
Learn how to sign your email using Thunderbird and GnuPG at:
http://dudu.dyn.2-h.org/nist/gpg-enigmail-howto

Index: BufferView.C
===================================================================
--- BufferView.C	(revision 17581)
+++ BufferView.C	(working copy)
@@ -277,10 +277,11 @@
 		pit_type pit;
 		pos_type pos;
 		boost::tie(pit, pos) = LyX::ref().session().lastFilePos().load(filename);
-		// if successfully move to pit (returned par_id is not zero), update metrics
+		// if successfully move to pit (returned par_id is not zero), update metrics and reset font
 		if (moveToPosition(pit, 0, pos).get<1>()) {
 			if (fitCursor())
 				updateMetrics(false);
+			buffer_->text().setCurrentFont(cursor_);
 		}
 	}
 
@@ -1096,18 +1097,19 @@
 	// Either the inset under the cursor or the
 	// surrounding LyXText will handle this event.
 
-	// Build temporary cursor.
+	//Get inset under mouse, if there is one
 	cmd.y = min(max(cmd.y, -1), height_);
-	InsetBase * inset = buffer_->text().editXY(cur, cmd.x, cmd.y);
-
+	InsetBase * inset = buffer_->text().checkInsetHit(cur.bv(), cmd.x, cmd.y);
+	
 	//lyxerr << BOOST_CURRENT_FUNCTION
 	//       << " * hit inset at tip: " << inset << endl;
 	//lyxerr << BOOST_CURRENT_FUNCTION
 	//       << " * created temp cursor:" << cur << endl;
 
-	// NOTE: editXY returns the top level inset of nested insets. If you happen
-	// to move from a text (inset=0) to a text inside an inset (e.g. an opened
-	// footnote inset, again inset=0), that inset will not be redrawn.
+	// NOTE: checkInsetHit returns the top level inset of nested insets. 
+	// If you happen to move from a text (inset=0) to a text inside an inset 
+	// (e.g. an opened footnote inset, again inset=0), that inset will not 
+	// be redrawn.
 	if (cmd.action == LFUN_MOUSE_MOTION && cmd.button() == mouse_button::none) {
 		bool need_redraw = false;
 		
@@ -1151,6 +1153,9 @@
 		// This should be changed if it is further utilized.
 		return need_redraw;
 	}
+	
+	// Build temporary cursor.
+	inset = buffer_->text().editXY(cur, cmd.x, cmd.y);
 
 	// Put anchor at the same position.
 	cur.resetAnchor();

Reply via email to