mirror of https://github.com/helix-editor/helix
feat: print helpful suggestion when using `:{,r}sort` incorrectly (#12585)
parent
259be07f05
commit
7c907e66f4
|
@ -2116,6 +2116,10 @@ fn sort_impl(
|
||||||
|
|
||||||
let selection = doc.selection(view.id);
|
let selection = doc.selection(view.id);
|
||||||
|
|
||||||
|
if selection.len() == 1 {
|
||||||
|
bail!("Sorting requires multiple selections. Hint: split selection first");
|
||||||
|
}
|
||||||
|
|
||||||
let mut fragments: Vec<_> = selection
|
let mut fragments: Vec<_> = selection
|
||||||
.slices(text)
|
.slices(text)
|
||||||
.map(|fragment| fragment.chunks().collect())
|
.map(|fragment| fragment.chunks().collect())
|
||||||
|
|
Loading…
Reference in New Issue