mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 18:08:10 +00:00
Fix the wrong cursor move when forward flag is false:
The forward flag is used to place the cursor behind the replaced text if it's true. But it's not correct to move the cursor if it's false. The cursor is in front of the replacement already after the replaceSelectionWithString() was done.
This commit is contained in:
parent
159108786d
commit
430cf3ee5e
@ -275,9 +275,6 @@ pair<bool, int> replaceOne(BufferView * bv, docstring searchstr,
|
|||||||
if (forward) {
|
if (forward) {
|
||||||
cur.pos() += replacestr.length();
|
cur.pos() += replacestr.length();
|
||||||
LASSERT(cur.pos() <= cur.lastpos(), /* */);
|
LASSERT(cur.pos() <= cur.lastpos(), /* */);
|
||||||
} else {
|
|
||||||
cur.pos() -= replacestr.length();
|
|
||||||
LASSERT(cur.pos() >= 0, /* */);
|
|
||||||
}
|
}
|
||||||
if (findnext)
|
if (findnext)
|
||||||
findOne(bv, searchstr, case_sens, whole, forward, false);
|
findOne(bv, searchstr, case_sens, whole, forward, false);
|
||||||
|
Loading…
Reference in New Issue
Block a user