Fix current lsp logs menu item not shown as selected

This commit is contained in:
Kirill Bulatov 2024-01-05 19:23:15 +02:00
parent c066480e31
commit 12b5dbff68

View file

@ -772,9 +772,10 @@ impl Render for LspLogToolbarItemView {
}), }),
); );
if server_selected && row.logs_selected { if server_selected && row.logs_selected {
let selected_ix = menu.select_last();
debug_assert_eq!( debug_assert_eq!(
Some(ix * 3 + 1), Some(ix * 3 + 1),
menu.select_last(), selected_ix,
"Could not scroll to a just added LSP menu item" "Could not scroll to a just added LSP menu item"
); );
} }
@ -822,9 +823,10 @@ impl Render for LspLogToolbarItemView {
}), }),
); );
if server_selected && row.rpc_trace_selected { if server_selected && row.rpc_trace_selected {
let selected_ix = menu.select_last();
debug_assert_eq!( debug_assert_eq!(
Some(ix * 3 + 2), Some(ix * 3 + 2),
menu.select_last(), selected_ix,
"Could not scroll to a just added LSP menu item" "Could not scroll to a just added LSP menu item"
); );
} }