diff options
author | Jeff Zhao <jeff.no.zhao@gmail.com> | 2021-09-04 21:55:48 -0400 |
---|---|---|
committer | Jeff Zhao <jeff.no.zhao@gmail.com> | 2021-09-04 21:56:00 -0400 |
commit | 85742f39a7407e3cbeb5977aa78589ddc4ec10cc (patch) | |
tree | bb45ed0b191316527481b69b8337cac017bf68d4 /src/util | |
parent | f0ba5842d26275ee2b7c15240495de9561382582 (diff) |
messages now have color support
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/input.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/util/input.rs b/src/util/input.rs index 48d023c..b11f635 100644 --- a/src/util/input.rs +++ b/src/util/input.rs @@ -55,11 +55,11 @@ pub fn process_finished_worker(context: &mut AppContext, res: std::io::Result<Io processed_size, total_size, ); - context.push_msg(msg); + context.message_queue_mut().push_success(msg); } Err(e) => { let msg = format!("{}", e); - context.push_msg(msg); + context.message_queue_mut().push_error(msg); } } } @@ -113,12 +113,12 @@ pub fn process_mouse(event: MouseEvent, context: &mut AppContext, backend: &mut if x < layout_rect[1].x { let command = KeyCommand::ParentCursorMoveUp(1); if let Err(e) = command.execute(context, backend) { - context.push_msg(e.to_string()); + context.message_queue_mut().push_error(e.to_string()); } } else if x < layout_rect[2].x { let command = KeyCommand::CursorMoveUp(1); if let Err(e) = command.execute(context, backend) { - context.push_msg(e.to_string()); + context.message_queue_mut().push_error(e.to_string()); } } else { // TODO: scroll in child list @@ -128,12 +128,12 @@ pub fn process_mouse(event: MouseEvent, context: &mut AppContext, backend: &mut if x < layout_rect[1].x { let command = KeyCommand::ParentCursorMoveDown(1); if let Err(e) = command.execute(context, backend) { - context.push_msg(e.to_string()); + context.message_queue_mut().push_error(e.to_string()); } } else if x < layout_rect[2].x { let command = KeyCommand::CursorMoveDown(1); if let Err(e) = command.execute(context, backend) { - context.push_msg(e.to_string()); + context.message_queue_mut().push_error(e.to_string()); } } else { // TODO: scroll in child list @@ -163,7 +163,7 @@ pub fn process_mouse(event: MouseEvent, context: &mut AppContext, backend: &mut } else { cursor_move::cursor_move(new_index, context) } { - context.push_msg(e.to_string()); + context.message_queue_mut().push_error(e.to_string()); } } } else { |