Switch to ^X as default submission key
This commit is contained in:
16
src/tui.rs
16
src/tui.rs
@@ -414,8 +414,8 @@ fn step(
|
||||
return Ok(true);
|
||||
}
|
||||
|
||||
// Global: Ctrl-S grades while in Game.
|
||||
if ctrl && key.code == KeyCode::Char('s') && matches!(screen, Screen::Game) {
|
||||
// Global: Ctrl-X grades while in Game.
|
||||
if ctrl && key.code == KeyCode::Char('x') && matches!(screen, Screen::Game) {
|
||||
grade(editor.text(), prog, registry, log)?;
|
||||
if matches!(log.entries.last(), Some(LogEntry::Completed)) {
|
||||
*screen = Screen::Completed;
|
||||
@@ -659,10 +659,10 @@ fn status_text(screen: &Screen, focus: Focus) -> String {
|
||||
" [↑/↓] choose · [Enter] confirm · [PgUp/PgDn] scroll · [q] quit".into()
|
||||
}
|
||||
(Screen::Game, Focus::Editor) => {
|
||||
" [Ctrl-S] grade · [Tab] focus log · [Esc] focus log · [Ctrl-Q] quit".into()
|
||||
" [Ctrl-X] grade · [Tab] focus log · [Esc] focus log · [Ctrl-Q] quit".into()
|
||||
}
|
||||
(Screen::Game, Focus::Game) => {
|
||||
" [Ctrl-S] grade · [Tab] focus editor · [↑/↓] scroll · [r] reset · [q] quit".into()
|
||||
" [Ctrl-X] grade · [Tab] focus editor · [↑/↓] scroll · [r] reset · [q] quit".into()
|
||||
}
|
||||
(Screen::ResetConfirm, _) => " [y] confirm wipe · any other key cancels".into(),
|
||||
(Screen::Completed, _) => {
|
||||
@@ -773,11 +773,11 @@ fn entry_lines(entry: &LogEntry) -> Vec<String> {
|
||||
"🌀 YAMLabyrinth — learn YAML by writing your way through.".to_string(),
|
||||
String::new(),
|
||||
" Each chamber reveals a target. Match it with YAML in the editor".to_string(),
|
||||
" on the right, then press Ctrl-S to grade your attempt.".to_string(),
|
||||
" on the right, then press Ctrl-X to grade your attempt.".to_string(),
|
||||
String::new(),
|
||||
" ⌨ Controls".to_string(),
|
||||
" [Tab] swap focus between log and editor".to_string(),
|
||||
" [Ctrl-S] grade your YAML".to_string(),
|
||||
" [Ctrl-X] grade your YAML".to_string(),
|
||||
" [↑/↓] scroll the log (when log is focused)".to_string(),
|
||||
" [PgUp/PgDn] scroll faster".to_string(),
|
||||
" [r] reset progress".to_string(),
|
||||
@@ -834,12 +834,12 @@ fn entry_lines(entry: &LogEntry) -> Vec<String> {
|
||||
score * 100.0,
|
||||
threshold * 100.0
|
||||
),
|
||||
" Refine your YAML and press Ctrl-S to retry.".to_string(),
|
||||
" Refine your YAML and press Ctrl-X to retry.".to_string(),
|
||||
],
|
||||
LogEntry::InvalidYaml { error } => vec![
|
||||
" ⚠ Couldn't parse YAML".to_string(),
|
||||
format!(" {error}"),
|
||||
" Fix it in the editor and press Ctrl-S to retry.".to_string(),
|
||||
" Fix it in the editor and press Ctrl-X to retry.".to_string(),
|
||||
],
|
||||
LogEntry::Completed => vec![
|
||||
" 🏆 Labyrinth complete!".to_string(),
|
||||
|
||||
Reference in New Issue
Block a user