Merge pull request #682 from zed-industries/vim-hjkl

Vim hjkl
This commit is contained in:
Nathan Sobo 2022-03-26 07:11:46 -06:00 committed by GitHub
commit d4436277ee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 847 additions and 177 deletions

View file

@ -40,6 +40,19 @@ impl<T: Clone> Selection<T> {
self.start.clone()
}
}
pub fn map<F, S>(&self, f: F) -> Selection<S>
where
F: Fn(T) -> S,
{
Selection::<S> {
id: self.id,
start: f(self.start.clone()),
end: f(self.end.clone()),
reversed: self.reversed,
goal: self.goal,
}
}
}
impl<T: Copy + Ord> Selection<T> {