forked from jess/Acord
1
0
Fork 0

fixing auto hiding context menu and adding a message passing debuging line

This commit is contained in:
Ahmed Ashraf 2026-05-06 04:11:03 +03:00
parent 6f1a5d31bf
commit 46ca844a93
1 changed files with 7 additions and 1 deletions

View File

@ -2485,6 +2485,8 @@ impl EditorState {
}
pub fn update(&mut self, message: Message) {
#[cfg(debug_assertions)]
println!("Received message: {:?}", message);
if self.render_mode == RenderMode::View && !Self::message_is_view_safe(&message) {
return;
}
@ -2501,7 +2503,11 @@ impl EditorState {
let preserve_context_menu = matches!(
&message,
Message::ShowContextMenu { .. }
Message::ShowContextMenu { .. } // Opening the menu
| Message::FocusedTableOp(..) // Menu item actions that operate on the focused table
| Message::TableMsg(_, TableMessage::CursorMove(_,_)) // Any table operation (including hover, cursor move)
| Message::TableMsg(_, TableMessage::CellEnter(_,_)) // Any table operation (including hover, cursor move)
| Message::HideContextMenu // Don't close before processing the close
);
if !preserve_context_menu && self.context_menu.is_some() {
self.context_menu = None;