mirror of
https://github.com/openai/codex.git
synced 2026-09-15 12:08:01 +00:00
clippy
This commit is contained in:
@@ -805,7 +805,7 @@ impl ChatComposer {
|
||||
collaboration_mode_indicator_line(self.collaboration_mode_indicator, show_cycle_hint)
|
||||
{
|
||||
if !spans.is_empty() {
|
||||
spans.push(" | ".dim().into());
|
||||
spans.push(" | ".dim());
|
||||
}
|
||||
spans.extend(collab.spans);
|
||||
}
|
||||
@@ -820,7 +820,7 @@ impl ChatComposer {
|
||||
let mut line =
|
||||
context_window_line(self.context_window_percent, self.context_window_used_tokens);
|
||||
if let Some(vim_mode) = self.vim_mode_indicator_span() {
|
||||
line.spans.push(" | ".dim().into());
|
||||
line.spans.push(" | ".dim());
|
||||
line.spans.push(vim_mode);
|
||||
}
|
||||
line
|
||||
@@ -4440,7 +4440,7 @@ mod tests {
|
||||
assert!(composer.textarea.is_vim_enabled());
|
||||
assert_eq!(
|
||||
composer.vim_mode_indicator_span(),
|
||||
Some("Vim: Normal".yellow())
|
||||
Some("Vim: Normal".magenta())
|
||||
);
|
||||
|
||||
composer.handle_key_event(KeyEvent::new(KeyCode::Char('i'), KeyModifiers::NONE));
|
||||
@@ -4485,7 +4485,7 @@ mod tests {
|
||||
composer.handle_key_event(KeyEvent::new(KeyCode::Esc, KeyModifiers::NONE));
|
||||
assert_eq!(
|
||||
composer.vim_mode_indicator_span(),
|
||||
Some("Vim: Normal".yellow())
|
||||
Some("Vim: Normal".magenta())
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
---
|
||||
source: tui/src/bottom_pane/chat_composer.rs
|
||||
assertion_line: 4027
|
||||
expression: terminal.backend()
|
||||
---
|
||||
" "
|
||||
"› Ask Codex to do anything "
|
||||
" "
|
||||
" "
|
||||
" "
|
||||
" "
|
||||
" "
|
||||
" "
|
||||
" esc esc to edit previous message 100% context left "
|
||||
@@ -0,0 +1,6 @@
|
||||
---
|
||||
source: tui/src/bottom_pane/footer.rs
|
||||
assertion_line: 1179
|
||||
expression: terminal.backend()
|
||||
---
|
||||
" esc again to edit previous message 100% context left "
|
||||
@@ -569,11 +569,10 @@ impl TextArea {
|
||||
}
|
||||
|
||||
fn handle_vim_normal(&mut self, event: KeyEvent) {
|
||||
if let Some(op) = self.vim_operator.take() {
|
||||
if self.handle_vim_operator(op, event) {
|
||||
if let Some(op) = self.vim_operator.take()
|
||||
&& self.handle_vim_operator(op, event) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
match event {
|
||||
KeyEvent {
|
||||
|
||||
@@ -123,11 +123,8 @@ impl ComposerInput {
|
||||
}
|
||||
|
||||
fn handle_slash_command(&mut self, cmd: SlashCommand) {
|
||||
match cmd {
|
||||
SlashCommand::Vim => {
|
||||
self.inner.toggle_vim_enabled();
|
||||
}
|
||||
_ => {}
|
||||
if cmd == SlashCommand::Vim {
|
||||
self.inner.toggle_vim_enabled();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user