editor: Dismiss mouse context menus on selections change (#28729)

Closes #ISSUE

Adds an extra subscription for mouse context menus (i.e. right click context menu) so that when selections change in the editor while the context menu is open (e.g. with vim motions), the context menu closes.

Release Notes:

- N/A
This commit is contained in:
Ben Kunkle 2025-04-17 12:38:12 -04:00 committed by GitHub
parent 133932ed74
commit e7afbbd725
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 38 additions and 6 deletions

View file

@ -1787,6 +1787,7 @@ impl Editor {
cx: &mut Context<Self>,
) {
self.mouse_context_menu = Some(MouseContextMenu::new(
self,
crate::mouse_context_menu::MenuPosition::PinnedToScreen(position),
context_menu,
None,