Add initial vim mode mode switching
Co-authored-by: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
parent
ccc276da7a
commit
bb9b36dccd
16 changed files with 683 additions and 49 deletions
|
@ -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> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue