The bug this patch fixes can be reproduced as follows:
1. enable continuous spell check.
2. type a misspelled word and press space so that it has a wavy red underline.
3. right-click and choose a suggested replacement word.
4. press the backspace button.

Result: nothing happens. If you press the backspace button again, then it works 
as normal. The problem occurs after step 3. cur.selection() is TRUE at this 
point so when backspace is pressed LyX tries to delete whatever is selected, 
which is nothing. You can see that cur.selection() is true by the activation of 
the scissors button after step 3.

Is this the right fix? This fixes the bug that I just reported, but I'm worried 
that it would have unintended consequences for other functions that use 
LFUN_WORD_REPLACE.

Could someone please check this?

Thank you,

Scott
Index: BufferView.cpp
===================================================================
--- BufferView.cpp	(revision 40821)
+++ BufferView.cpp	(working copy)
@@ -1568,6 +1568,7 @@
 		if (lyxreplace(this, cmd, has_deleted)) {
 			dr.forceBufferUpdate();
 			dr.screenUpdate(Update::Force | Update::FitCursor);
+			cur.clearSelection();
 		}
 		break;
 	}

Reply via email to