mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 10:00:33 +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) {
|
||||
cur.pos() += replacestr.length();
|
||||
LASSERT(cur.pos() <= cur.lastpos(), /* */);
|
||||
} else {
|
||||
cur.pos() -= replacestr.length();
|
||||
LASSERT(cur.pos() >= 0, /* */);
|
||||
}
|
||||
if (findnext)
|
||||
findOne(bv, searchstr, case_sens, whole, forward, false);
|
||||
|
Loading…
Reference in New Issue
Block a user