Do not crash whenever S matches the whole selection and hence does not select anything

Fixes #787
This commit is contained in:
Maxime Coste 2016-09-04 11:15:27 +01:00
parent 97e36233fb
commit 4d13e6fb88
4 changed files with 4 additions and 0 deletions

View File

@ -691,6 +691,9 @@ void split_selections(SelectionList& selections, const Regex& regex, unsigned ca
if (begin.coord() <= sel.max())
result.push_back(keep_direction({ begin.coord(), sel.max() }, sel));
}
if (result.empty())
throw runtime_error("nothing selected");
selections = std::move(result);
}

View File

@ -0,0 +1 @@
S.<ret>

View File

View File