Exit with ctrl m
This commit is contained in:
@@ -7,6 +7,7 @@ use ratatui::layout::{Constraint, Layout};
|
||||
use ratatui::style::{Color, Style};
|
||||
use ratatui::widgets::{Block, Borders};
|
||||
use ratatui::Terminal;
|
||||
use std::process::exit;
|
||||
use std::{i64, io};
|
||||
use tui_textarea::{Input, Key, TextArea};
|
||||
|
||||
@@ -104,10 +105,7 @@ pub async fn get_user_rating(db: &Database) -> Result<(i64, i64)> {
|
||||
key: Key::Char('m'),
|
||||
ctrl: true,
|
||||
..
|
||||
}
|
||||
| Input {
|
||||
key: Key::Enter, ..
|
||||
} => {}
|
||||
} => exit(0),
|
||||
input => {
|
||||
// TextArea::input returns if the input modified its text
|
||||
if textarea.input(input) {
|
||||
@@ -142,10 +140,7 @@ pub async fn get_user_rating(db: &Database) -> Result<(i64, i64)> {
|
||||
key: Key::Char('m'),
|
||||
ctrl: true,
|
||||
..
|
||||
}
|
||||
| Input {
|
||||
key: Key::Enter, ..
|
||||
} => {}
|
||||
} => exit(0),
|
||||
input => {
|
||||
// TextArea::input returns if the input modified its text
|
||||
if textarea.input(input) {
|
||||
|
Reference in New Issue
Block a user