delete d;
}
+// Put this user variable in lyxrc or pass it through setFullScreen()
+static int const max_row_width = 700;
int BufferView::rightMargin() const
{
- return full_screen_? width_ / 4 : 10;
+ if (!full_screen_ || width_ < max_row_width + 20)
+ return 10;
+
+ return (width_ - max_row_width) / 2;
}
int BufferView::leftMargin() const
{
- return full_screen_? width_ / 4 : 10;
+ return rightMargin();
}
DocIterator dit = b->getParFromID(id);
if (dit.atEnd()) {
LYXERR(Debug::INFO, "No matching paragraph found! [" << id << "].");
+ ++i;
+ continue;
+ }
+ LYXERR(Debug::INFO, "Paragraph " << dit.paragraph().id()
+ << " found in buffer `"
+ << b->absFileName() << "'.");
+
+ if (b == &buffer_) {
+ // Set the cursor
+ setCursor(dit);
+ processUpdateFlags(Update::Force | Update::FitCursor);
} else {
- LYXERR(Debug::INFO, "Paragraph " << dit.paragraph().id()
- << " found in buffer `"
- << b->absFileName() << "'.");
-
- if (b == &buffer_) {
- // Set the cursor
- setCursor(dit);
- showCursor();
- } else {
- // Switch to other buffer view and resend cmd
- theLyXFunc().dispatch(FuncRequest(
- LFUN_BUFFER_SWITCH, b->absFileName()));
- theLyXFunc().dispatch(cmd);
- }
- break;
+ // Switch to other buffer view and resend cmd
+ theLyXFunc().dispatch(FuncRequest(
+ LFUN_BUFFER_SWITCH, b->absFileName()));
+ theLyXFunc().dispatch(cmd);
}
- ++i;
+ break;
}
break;
}
break;
case LFUN_WORD_FIND:
- find(this, cmd);
+ if (find(this, cmd))
+ showCursor();
+ else
+ message(_("String not found!"));
break;
case LFUN_WORD_REPLACE: {
} else
d->cursor_.setSelection(d->cursor_, length);
}
+ // Ensure a redraw happens in any case because the new selection could
+ // possibly be on the same screen as the previous selection.
+ processUpdateFlags(Update::Force | Update::FitCursor);
}