Merge branch 'main' into project_search_design

This commit is contained in:
Piotr Osiewicz
2023-08-09 12:30:48 +02:00
95 changed files with 2955 additions and 2137 deletions
+4 -4
View File
@@ -10,7 +10,7 @@ pub fn init(cx: &mut AppContext) {
fn focused(EditorFocused(editor): &EditorFocused, cx: &mut AppContext) {
if let Some(previously_active_editor) = Vim::read(cx).active_editor.clone() {
cx.update_window(previously_active_editor.window_id(), |cx| {
previously_active_editor.window().update(cx, |cx| {
Vim::update(cx, |vim, cx| {
vim.update_active_editor(cx, |previously_active_editor, cx| {
vim.unhook_vim_settings(previously_active_editor, cx)
@@ -19,7 +19,7 @@ fn focused(EditorFocused(editor): &EditorFocused, cx: &mut AppContext) {
});
}
cx.update_window(editor.window_id(), |cx| {
editor.window().update(cx, |cx| {
Vim::update(cx, |vim, cx| {
vim.set_active_editor(editor.clone(), cx);
});
@@ -27,7 +27,7 @@ fn focused(EditorFocused(editor): &EditorFocused, cx: &mut AppContext) {
}
fn blurred(EditorBlurred(editor): &EditorBlurred, cx: &mut AppContext) {
cx.update_window(editor.window_id(), |cx| {
editor.window().update(cx, |cx| {
Vim::update(cx, |vim, cx| {
if let Some(previous_editor) = vim.active_editor.clone() {
if previous_editor == editor.clone() {
@@ -41,7 +41,7 @@ fn blurred(EditorBlurred(editor): &EditorBlurred, cx: &mut AppContext) {
}
fn released(EditorReleased(editor): &EditorReleased, cx: &mut AppContext) {
cx.update_window(editor.window_id(), |cx| {
editor.window().update(cx, |cx| {
cx.update_default_global(|vim: &mut Vim, _| {
if let Some(previous_editor) = vim.active_editor.clone() {
if previous_editor == editor.clone() {
+1 -1
View File
@@ -20,7 +20,7 @@ impl ModeIndicator {
if let Some(mode_indicator) = handle.upgrade(cx) {
match event {
VimEvent::ModeChanged { mode } => {
cx.update_window(mode_indicator.window_id(), |cx| {
mode_indicator.window().update(cx, |cx| {
mode_indicator.update(cx, move |mode_indicator, cx| {
mode_indicator.set_mode(mode, cx);
})
+2 -2
View File
@@ -85,8 +85,8 @@ impl<'a> VimTestContext<'a> {
}
pub fn set_state(&mut self, text: &str, mode: Mode) -> ContextHandle {
let window_id = self.window_id;
self.update_window(window_id, |cx| {
let window = self.window;
window.update(self.cx.cx.cx, |cx| {
Vim::update(cx, |vim, cx| {
vim.switch_mode(mode, false, cx);
})