File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,8 @@ use ratatui::{
2020} ;
2121use std:: io:: stdout;
2222
23+ const QUIT_KEY : char = 'q' ;
24+
2325#[ derive( Parser ) ]
2426#[ command( bin_name = "display" ) ]
2527struct Args {
@@ -45,7 +47,7 @@ pub async fn invoke(args: &[String], ctx: &mut Context) -> Result<String> {
4547 select ! {
4648 msg = reader. next( ) => match msg {
4749 Some ( Ok ( Event :: Key ( e) ) ) => match e. code {
48- KeyCode :: Char ( 'q' ) => break ,
50+ KeyCode :: Char ( QUIT_KEY ) => break ,
4951 _ => if let Some ( code) = key_code_to_js( e. code) {
5052 ctx. lh. put( & path. as_lh_vec( ) , Model :: InputEvent ( InputEvent {
5153 source: 0 ,
@@ -66,7 +68,7 @@ pub async fn invoke(args: &[String], ctx: &mut Context) -> Result<String> {
6668 lh_frame,
6769 frame. size( ) . width. into( ) ,
6870 frame. size( ) . height. into( ) ,
69- path . to_string ( )
71+ format! ( "{} ({}: quit)" , path , QUIT_KEY ) ,
7072 ) ;
7173 frame. render_widget( canvas, frame. size( ) ) ;
7274 } ) ?;
You can’t perform that action at this time.
0 commit comments