From 1383629299e2b9ce8d4295d1267ce3ae0beaedd9 Mon Sep 17 00:00:00 2001
From: Enrico Forestieri <forenr@lyx.org>
Date: Sun, 14 Sep 2008 17:51:46 +0000
Subject: [PATCH] Fix bug 5246 http://bugzilla.lyx.org/show_bug.cgi?id=5246

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26403 a592a061-630c-0410-9148-cb99ea01b6c8
---
 src/Cursor.cpp | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/Cursor.cpp b/src/Cursor.cpp
index 32c0ea0cf7..92b9110ba7 100644
--- a/src/Cursor.cpp
+++ b/src/Cursor.cpp
@@ -1829,6 +1829,8 @@ void Cursor::handleFont(string const & font)
 		safe = cap::grabAndEraseSelection(*this);
 	}
 
+	recordUndoInset();
+
 	if (lastpos() != 0) {
 		// something left in the cell
 		if (pos() == 0) {
@@ -1848,8 +1850,9 @@ void Cursor::handleFont(string const & font)
 		}
 	} else {
 		// nothing left in the cell
-		pullArg();
+		popBackward();
 		plainErase();
+		resetAnchor();
 	}
 	insert(safe);
 }