Le 09/03/2012 11:21, Scott Kostyshak a écrit :
From: Jean-Marc Lasgouttes [lasgout...@lyx.org]
Sent: Thursday, March 01, 2012 11:05 AM

I would try to fix the actual place that modifies cursor, which is
probably in findOne (lyxfind.cpp).

replaceOne is the function called.

What is the point of the following code in CutAndPaste.cpp's function 
replaceSelectionWithString:

         // select the replacement
         if (backwards) {
                 selbeg.pos() += str.length();
                 cur.setSelection(selbeg, -int(str.length()));
         } else
                 cur.setSelection(selbeg, str.length());

cur.setSelection() is what is setting the selection in this case and I don't 
see why anything should be selected after the replacement. Applying the 
attached patch fixes the bug I described, but it must not be the right thing to 
do. I'm just not sure why. What goes wrong when this code is removed?

"svn blame" tells me that I am the one who did that
  http://www.lyx.org/trac/changeset/14708/lyxsvn
The point was to fix bug 2068
  http://www.lyx.org/trac/ticket/2068
which is related to spellchecker. [although I do not remember anything about that :)]

However, things have happened to the spellchecker since then, and replaceSelectionWithString is not used there anymore.

So I suspect your patch is correct.

JMarc

Reply via email to