vim: Use explicit global, not default (#2987)
This should have no user-visible impact, but tidies up one of the awkwardnesses of how vim uses global state at the moment. Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
This commit is contained in:
commit
1295e5b41f
2 changed files with 7 additions and 4 deletions
|
@ -40,6 +40,7 @@ fn blurred(EditorBlurred(editor): &EditorBlurred, cx: &mut AppContext) {
|
|||
if previous_editor == editor.clone() {
|
||||
vim.clear_operator(cx);
|
||||
vim.active_editor = None;
|
||||
vim.editor_subscription = None;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -50,10 +51,11 @@ fn blurred(EditorBlurred(editor): &EditorBlurred, cx: &mut AppContext) {
|
|||
|
||||
fn released(EditorReleased(editor): &EditorReleased, cx: &mut AppContext) {
|
||||
editor.window().update(cx, |cx| {
|
||||
cx.update_default_global(|vim: &mut Vim, _| {
|
||||
Vim::update(cx, |vim, _| {
|
||||
if let Some(previous_editor) = vim.active_editor.clone() {
|
||||
if previous_editor == editor.clone() {
|
||||
vim.active_editor = None;
|
||||
vim.editor_subscription = None;
|
||||
}
|
||||
}
|
||||
vim.editor_states.remove(&editor.id())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue