add tooltip hint for shell commands (!) (#8926)
I didn't know this existed because its not listed in the hints.
This commit is contained in:
parent
4156060416
commit
5bc3e325a6
6 changed files with 50 additions and 18 deletions
|
|
@ -159,6 +159,7 @@ fn esc_hint_line(esc_backtrack_hint: bool) -> Line<'static> {
|
|||
|
||||
fn shortcut_overlay_lines(state: ShortcutsState) -> Vec<Line<'static>> {
|
||||
let mut commands = Line::from("");
|
||||
let mut shell_commands = Line::from("");
|
||||
let mut newline = Line::from("");
|
||||
let mut file_paths = Line::from("");
|
||||
let mut paste_image = Line::from("");
|
||||
|
|
@ -171,6 +172,7 @@ fn shortcut_overlay_lines(state: ShortcutsState) -> Vec<Line<'static>> {
|
|||
if let Some(text) = descriptor.overlay_entry(state) {
|
||||
match descriptor.id {
|
||||
ShortcutId::Commands => commands = text,
|
||||
ShortcutId::ShellCommands => shell_commands = text,
|
||||
ShortcutId::InsertNewline => newline = text,
|
||||
ShortcutId::FilePaths => file_paths = text,
|
||||
ShortcutId::PasteImage => paste_image = text,
|
||||
|
|
@ -184,6 +186,7 @@ fn shortcut_overlay_lines(state: ShortcutsState) -> Vec<Line<'static>> {
|
|||
|
||||
let ordered = vec![
|
||||
commands,
|
||||
shell_commands,
|
||||
newline,
|
||||
file_paths,
|
||||
paste_image,
|
||||
|
|
@ -261,6 +264,7 @@ fn context_window_line(percent: Option<i64>, used_tokens: Option<i64>) -> Line<'
|
|||
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
|
||||
enum ShortcutId {
|
||||
Commands,
|
||||
ShellCommands,
|
||||
InsertNewline,
|
||||
FilePaths,
|
||||
PasteImage,
|
||||
|
|
@ -344,6 +348,15 @@ const SHORTCUTS: &[ShortcutDescriptor] = &[
|
|||
prefix: "",
|
||||
label: " for commands",
|
||||
},
|
||||
ShortcutDescriptor {
|
||||
id: ShortcutId::ShellCommands,
|
||||
bindings: &[ShortcutBinding {
|
||||
key: key_hint::plain(KeyCode::Char('!')),
|
||||
condition: DisplayCondition::Always,
|
||||
}],
|
||||
prefix: "",
|
||||
label: " for shell commands",
|
||||
},
|
||||
ShortcutDescriptor {
|
||||
id: ShortcutId::InsertNewline,
|
||||
bindings: &[
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
---
|
||||
source: tui/src/bottom_pane/chat_composer.rs
|
||||
assertion_line: 2151
|
||||
expression: terminal.backend()
|
||||
---
|
||||
" "
|
||||
|
|
@ -10,8 +11,8 @@ expression: terminal.backend()
|
|||
" "
|
||||
" "
|
||||
" "
|
||||
" / for commands shift + enter for newline "
|
||||
" @ for file paths ctrl + v to paste images "
|
||||
" ctrl + g to edit in external editor esc again to edit previous message "
|
||||
" ctrl + c to exit "
|
||||
" ctrl + t to view transcript "
|
||||
" / for commands ! for shell commands "
|
||||
" shift + enter for newline @ for file paths "
|
||||
" ctrl + v to paste images ctrl + g to edit in external editor "
|
||||
" esc again to edit previous message ctrl + c to exit "
|
||||
" ctrl + t to view transcript "
|
||||
|
|
|
|||
|
|
@ -1,9 +1,10 @@
|
|||
---
|
||||
source: tui/src/bottom_pane/footer.rs
|
||||
assertion_line: 455
|
||||
expression: terminal.backend()
|
||||
---
|
||||
" / for commands shift + enter for newline "
|
||||
" @ for file paths ctrl + v to paste images "
|
||||
" ctrl + g to edit in external editor esc again to edit previous message "
|
||||
" ctrl + c to exit "
|
||||
" ctrl + t to view transcript "
|
||||
" / for commands ! for shell commands "
|
||||
" shift + enter for newline @ for file paths "
|
||||
" ctrl + v to paste images ctrl + g to edit in external editor "
|
||||
" esc again to edit previous message ctrl + c to exit "
|
||||
" ctrl + t to view transcript "
|
||||
|
|
|
|||
|
|
@ -203,6 +203,7 @@ fn esc_hint_line(esc_backtrack_hint: bool) -> Line<'static> {
|
|||
|
||||
fn shortcut_overlay_lines(state: ShortcutsState) -> Vec<Line<'static>> {
|
||||
let mut commands = Line::from("");
|
||||
let mut shell_commands = Line::from("");
|
||||
let mut newline = Line::from("");
|
||||
let mut file_paths = Line::from("");
|
||||
let mut paste_image = Line::from("");
|
||||
|
|
@ -214,6 +215,7 @@ fn shortcut_overlay_lines(state: ShortcutsState) -> Vec<Line<'static>> {
|
|||
if let Some(text) = descriptor.overlay_entry(state) {
|
||||
match descriptor.id {
|
||||
ShortcutId::Commands => commands = text,
|
||||
ShortcutId::ShellCommands => shell_commands = text,
|
||||
ShortcutId::InsertNewline => newline = text,
|
||||
ShortcutId::FilePaths => file_paths = text,
|
||||
ShortcutId::PasteImage => paste_image = text,
|
||||
|
|
@ -226,6 +228,7 @@ fn shortcut_overlay_lines(state: ShortcutsState) -> Vec<Line<'static>> {
|
|||
|
||||
let ordered = vec![
|
||||
commands,
|
||||
shell_commands,
|
||||
newline,
|
||||
file_paths,
|
||||
paste_image,
|
||||
|
|
@ -302,6 +305,7 @@ fn context_window_line(percent: Option<i64>, used_tokens: Option<i64>) -> Line<'
|
|||
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
|
||||
enum ShortcutId {
|
||||
Commands,
|
||||
ShellCommands,
|
||||
InsertNewline,
|
||||
FilePaths,
|
||||
PasteImage,
|
||||
|
|
@ -384,6 +388,15 @@ const SHORTCUTS: &[ShortcutDescriptor] = &[
|
|||
prefix: "",
|
||||
label: " for commands",
|
||||
},
|
||||
ShortcutDescriptor {
|
||||
id: ShortcutId::ShellCommands,
|
||||
bindings: &[ShortcutBinding {
|
||||
key: key_hint::plain(KeyCode::Char('!')),
|
||||
condition: DisplayCondition::Always,
|
||||
}],
|
||||
prefix: "",
|
||||
label: " for shell commands",
|
||||
},
|
||||
ShortcutDescriptor {
|
||||
id: ShortcutId::InsertNewline,
|
||||
bindings: &[
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
---
|
||||
source: tui2/src/bottom_pane/chat_composer.rs
|
||||
assertion_line: 2093
|
||||
expression: terminal.backend()
|
||||
---
|
||||
" "
|
||||
|
|
@ -10,7 +11,8 @@ expression: terminal.backend()
|
|||
" "
|
||||
" "
|
||||
" "
|
||||
" / for commands shift + enter for newline "
|
||||
" @ for file paths ctrl + v to paste images "
|
||||
" esc again to edit previous message ctrl + c to exit "
|
||||
" ctrl + t to view transcript "
|
||||
" / for commands ! for shell commands "
|
||||
" shift + enter for newline @ for file paths "
|
||||
" ctrl + v to paste images esc again to edit previous message "
|
||||
" ctrl + c to exit "
|
||||
" ctrl + t to view transcript "
|
||||
|
|
|
|||
|
|
@ -1,8 +1,10 @@
|
|||
---
|
||||
source: tui2/src/bottom_pane/footer.rs
|
||||
assertion_line: 486
|
||||
expression: terminal.backend()
|
||||
---
|
||||
" / for commands shift + enter for newline "
|
||||
" @ for file paths ctrl + v to paste images "
|
||||
" esc again to edit previous message ctrl + c to exit "
|
||||
" ctrl + t to view transcript "
|
||||
" / for commands ! for shell commands "
|
||||
" shift + enter for newline @ for file paths "
|
||||
" ctrl + v to paste images esc again to edit previous message "
|
||||
" ctrl + c to exit "
|
||||
" ctrl + t to view transcript "
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue