|
|
@ -2,7 +2,7 @@ use crate::compositor::{Component, Compositor, Context, EventResult};
|
|
|
|
use crate::{alt, ctrl, key, shift, ui};
|
|
|
|
use crate::{alt, ctrl, key, shift, ui};
|
|
|
|
use crossterm::event::Event;
|
|
|
|
use crossterm::event::Event;
|
|
|
|
use helix_view::input::KeyEvent;
|
|
|
|
use helix_view::input::KeyEvent;
|
|
|
|
use helix_view::keyboard::{KeyCode, KeyModifiers};
|
|
|
|
use helix_view::keyboard::KeyCode;
|
|
|
|
use std::{borrow::Cow, ops::RangeFrom};
|
|
|
|
use std::{borrow::Cow, ops::RangeFrom};
|
|
|
|
use tui::buffer::Buffer as Surface;
|
|
|
|
use tui::buffer::Buffer as Surface;
|
|
|
|
use tui::widgets::{Block, Borders, Widget};
|
|
|
|
use tui::widgets::{Block, Borders, Widget};
|
|
|
@ -529,11 +529,11 @@ impl Component for Prompt {
|
|
|
|
(self.callback_fn)(cx, &self.line, PromptEvent::Update)
|
|
|
|
(self.callback_fn)(cx, &self.line, PromptEvent::Update)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
ctrl!('q') => self.exit_selection(),
|
|
|
|
ctrl!('q') => self.exit_selection(),
|
|
|
|
// any char event that's not combined with control or mapped to any other combo
|
|
|
|
// any char event that's not mapped to any other combo
|
|
|
|
KeyEvent {
|
|
|
|
KeyEvent {
|
|
|
|
code: KeyCode::Char(c),
|
|
|
|
code: KeyCode::Char(c),
|
|
|
|
modifiers,
|
|
|
|
modifiers: _,
|
|
|
|
} if !modifiers.contains(KeyModifiers::CONTROL) => {
|
|
|
|
} => {
|
|
|
|
self.insert_char(c, cx);
|
|
|
|
self.insert_char(c, cx);
|
|
|
|
(self.callback_fn)(cx, &self.line, PromptEvent::Update);
|
|
|
|
(self.callback_fn)(cx, &self.line, PromptEvent::Update);
|
|
|
|
}
|
|
|
|
}
|
|
|
|