We now use a new variable, "wrap", to track if a wrap should be
done, which is true either if "auto_wrap" is true or if the user
chooses to wrap in the dialog.
This preserves the meaning of the "auto_wrap" variable and also
removes the confusion of why the previous code of
if (!auto_wrap) {
...
}
if (auto_wrap) {
did not use an "else" instead of the second "if".
No change in functionality.
bool findOne(BufferView * bv, docstring const & searchstr,
bool case_sens, bool whole, bool forward,
bool findOne(BufferView * bv, docstring const & searchstr,
bool case_sens, bool whole, bool forward,
- bool find_del, bool check_wrap, bool auto_wrap,
+ bool find_del, bool check_wrap, bool const auto_wrap,
bool instant, bool onlysel)
{
// Clean up previous selections with empty searchstr on instant
bool instant, bool onlysel)
{
// Clean up previous selections with empty searchstr on instant
}
else if (check_wrap) {
DocIterator cur_orig(bv->cursor());
}
else if (check_wrap) {
DocIterator cur_orig(bv->cursor());
if (!auto_wrap) {
docstring q;
if (forward)
if (!auto_wrap) {
docstring q;
if (forward)
"Continue searching from the end?");
int wrap_answer = frontend::Alert::prompt(_("Wrap search?"),
q, 0, 1, _("&Yes"), _("&No"));
"Continue searching from the end?");
int wrap_answer = frontend::Alert::prompt(_("Wrap search?"),
q, 0, 1, _("&Yes"), _("&No"));
- auto_wrap = wrap_answer == 0;
+ wrap = wrap_answer == 0;
if (forward) {
bv->cursor().clear();
bv->cursor().push_back(CursorSlice(bv->buffer().inset()));
if (forward) {
bv->cursor().clear();
bv->cursor().push_back(CursorSlice(bv->buffer().inset()));
bool findOne(BufferView * bv, docstring const & searchstr,
bool case_sens, bool whole, bool forward,
bool find_del = true, bool check_wrap = false,
bool findOne(BufferView * bv, docstring const & searchstr,
bool case_sens, bool whole, bool forward,
bool find_del = true, bool check_wrap = false,
- bool auto_wrap = false, bool instant = false,
+ bool const auto_wrap = false, bool instant = false,
bool onlysel = false);
/** Parse the string encoding of the replace request that is found in
bool onlysel = false);
/** Parse the string encoding of the replace request that is found in