mirror of
https://github.com/mawww/kakoune.git
synced 2024-11-11 01:37:41 +03:00
Do not crash whenever S matches the whole selection and hence does not select anything
Fixes #787
This commit is contained in:
parent
97e36233fb
commit
4d13e6fb88
@ -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);
|
||||
}
|
||||
|
||||
|
1
test/regression/787-crash-after-S/cmd
Normal file
1
test/regression/787-crash-after-S/cmd
Normal file
@ -0,0 +1 @@
|
||||
S.<ret>
|
0
test/regression/787-crash-after-S/in
Normal file
0
test/regression/787-crash-after-S/in
Normal file
0
test/regression/787-crash-after-S/out
Normal file
0
test/regression/787-crash-after-S/out
Normal file
Loading…
Reference in New Issue
Block a user