}
-void replaceSelectionWithString(Cursor & cur, docstring const & str, bool backwards)
+void replaceSelectionWithString(Cursor & cur, docstring const & str)
{
cur.recordUndo();
DocIterator selbeg = cur.selectionBegin();
// Cut the selection
cutSelection(cur, true, false);
-
- // select the replacement
- if (backwards) {
- selbeg.pos() += str.length();
- cur.setSelection(selbeg, -int(str.length()));
- } else
- cur.setSelection(selbeg, str.length());
}
/**
* Replace using the font of the first selected character and select
- * the new string. When \c backwards == false, set anchor before
- * cursor; otherwise set cursor before anchor.
- * Does handle undo.
+ * the new string. Does handle undo.
*/
-void replaceSelectionWithString(Cursor & cur, docstring const & str,
- bool backwards);
+void replaceSelectionWithString(Cursor & cur, docstring const & str);
/// If a selection exists, delete it without pushing it to the cut buffer.
/// Does handle undo.
void replaceSelection(Cursor & cur);
if (bv->buffer().isReadonly())
return pair<bool, int>(false, 0);
- cap::replaceSelectionWithString(cur, replacestr, forward);
+ cap::replaceSelectionWithString(cur, replacestr);
if (forward) {
cur.pos() += replacestr.length();
LASSERT(cur.pos() <= cur.lastpos(), /* */);