yazi/yazi-fm/src/app/commands/update_notify.rs

21 lines
493 B
Rust

use ratatui::layout::Rect;
use yazi_adapter::Dimension;
use yazi_shared::event::CmdCow;
use crate::{app::App, notify};
impl App {
pub(crate) fn update_notify(&mut self, cmd: CmdCow) {
let Dimension { rows, columns, .. } = Dimension::available();
let area =
notify::Notify::available(Rect { x: 0, y: 0, width: columns, height: rows });
self.core.notify.tick(cmd, area);
if self.core.notify.messages.is_empty() {
self.render();
} else {
self.render_partially();
}
}
}