mirror of
https://github.com/helix-editor/helix.git
synced 2025-10-06 00:13:28 +02:00
feat: passing multile of the same files in the arguments places a cursor at each position (#12192)
Co-authored-by: Nikita Revenco <154856872+NikitaRevenco@users.noreply.github.com> Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
This commit is contained in:
@@ -619,7 +619,6 @@ impl Selection {
|
||||
self
|
||||
}
|
||||
|
||||
// TODO: consume an iterator or a vec to reduce allocations?
|
||||
#[must_use]
|
||||
pub fn new(ranges: SmallVec<[Range; 1]>, primary_index: usize) -> Self {
|
||||
assert!(!ranges.is_empty());
|
||||
@@ -721,6 +720,12 @@ impl IntoIterator for Selection {
|
||||
}
|
||||
}
|
||||
|
||||
impl FromIterator<Range> for Selection {
|
||||
fn from_iter<T: IntoIterator<Item = Range>>(ranges: T) -> Self {
|
||||
Self::new(ranges.into_iter().collect(), 0)
|
||||
}
|
||||
}
|
||||
|
||||
impl From<Range> for Selection {
|
||||
fn from(range: Range) -> Self {
|
||||
Self {
|
||||
|
Reference in New Issue
Block a user