Skip to content

Commit

Permalink
Don't re-render the menu so often (cherry-pick #20914) (#20915)
Browse files Browse the repository at this point in the history
Cherry-picked Don't re-render the menu so often (#20914)

Closes #20710

Release Notes:

- Fixes opening the menu when Chinese Pinyin keyboard is in use

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
  • Loading branch information
gcp-cherry-pick-bot[bot] and ConradIrwin authored Nov 20, 2024
1 parent 8444a6f commit 31ad658
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions crates/zed/src/zed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -824,8 +824,13 @@ pub fn handle_keymap_file_changes(
})
.detach();

cx.on_keyboard_layout_change(move |_| {
keyboard_layout_tx.unbounded_send(()).ok();
let mut current_mapping = settings::get_key_equivalents(cx.keyboard_layout());
cx.on_keyboard_layout_change(move |cx| {
let next_mapping = settings::get_key_equivalents(cx.keyboard_layout());
if next_mapping != current_mapping {
current_mapping = next_mapping;
keyboard_layout_tx.unbounded_send(()).ok();
}
})
.detach();

Expand Down

0 comments on commit 31ad658

Please sign in to comment.