Skip to content

Commit 741a546

Browse files
committed
Fix numeric prefix handling in input mode
1 parent 3f49e5f commit 741a546

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

src/app.rs

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -154,20 +154,24 @@ impl App<'_> {
154154
self.numeric_prefix.clear();
155155
}
156156
None => {
157-
if let KeyCode::Char(c) = key.code {
157+
if let StatusLine::Input(_, _, _) = self.status_line {
158+
// In input mode, pass all key events to the view
159+
// fixme: currently, the only thing that processes key_event is searching the list,
160+
// so this probably works, but it's not the right process...
161+
self.numeric_prefix.clear();
162+
self.view.handle_event(
163+
UserEventWithCount::from_event(UserEvent::Unknown),
164+
key,
165+
);
166+
} else if let KeyCode::Char(c) = key.code {
167+
// Accumulate numeric prefix
158168
if c.is_ascii_digit()
159169
&& (c != '0' || !self.numeric_prefix.is_empty())
160170
{
161171
self.numeric_prefix.push(c);
162172
continue;
163173
}
164174
}
165-
166-
self.numeric_prefix.clear();
167-
self.view.handle_event(
168-
UserEventWithCount::from_event(UserEvent::Unknown),
169-
key,
170-
);
171175
}
172176
}
173177
}

0 commit comments

Comments
 (0)