Skip to content

Commit

Permalink
rename ctx to cx
Browse files Browse the repository at this point in the history
  • Loading branch information
cossonleo committed Jan 24, 2022
1 parent 35651f4 commit 8e985be
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions helix-term/src/ui/picker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,15 +252,15 @@ impl<T: 'static> Component for FilePicker<T> {
}
}

fn handle_event(&mut self, event: Event, ctx: &mut Context) -> EventResult {
fn handle_event(&mut self, event: Event, cx: &mut Context) -> EventResult {
let key_event = match event {
Event::Key(event) => event,
_ => return self.picker.handle_event(event, ctx),
_ => return self.picker.handle_event(event, cx),
};

let mut filter = |d| {
self.picker.options.retain(|item| {
(self.file_fn)(ctx.editor, item)
(self.file_fn)(cx.editor, item)
.map(|fl| fl.0.starts_with(d))
.unwrap_or(false)
});
Expand All @@ -276,12 +276,12 @@ impl<T: 'static> Component for FilePicker<T> {
EventResult::Consumed(None)
}
ctrl!('f') => {
if let Some(cwd) = doc!(ctx.editor).path().and_then(|p| p.parent()) {
if let Some(cwd) = doc!(cx.editor).path().and_then(|p| p.parent()) {
filter(cwd);
}
EventResult::Consumed(None)
}
_ => self.picker.handle_event(event, ctx),
_ => self.picker.handle_event(event, cx),
}
// TODO: keybinds for scrolling preview
}
Expand Down

0 comments on commit 8e985be

Please sign in to comment.