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