mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-25 17:44:59 +00:00
Fixed #2674 (Find and replace should restore initial cursor position), occurring on replace all.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33818 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
2211213cb9
commit
4bac24026d
@ -171,6 +171,8 @@ int replaceAll(BufferView * bv,
|
|||||||
if (!searchAllowed(bv, searchstr) || buf.isReadonly())
|
if (!searchAllowed(bv, searchstr) || buf.isReadonly())
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
DocIterator cur_orig(bv->cursor());
|
||||||
|
|
||||||
MatchString const match(searchstr, cs, mw);
|
MatchString const match(searchstr, cs, mw);
|
||||||
int num = 0;
|
int num = 0;
|
||||||
|
|
||||||
@ -198,6 +200,10 @@ int replaceAll(BufferView * bv,
|
|||||||
bv->putSelectionAt(doc_iterator_begin(&buf), 0, false);
|
bv->putSelectionAt(doc_iterator_begin(&buf), 0, false);
|
||||||
if (num)
|
if (num)
|
||||||
buf.markDirty();
|
buf.markDirty();
|
||||||
|
|
||||||
|
cur_orig.fixIfBroken();
|
||||||
|
bv->setCursor(cur_orig);
|
||||||
|
|
||||||
return num;
|
return num;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user