Merge remote-tracking branch 'origin/main' into app-menus

This commit is contained in:
Nathan Sobo 2023-12-05 16:54:38 -07:00
commit d2fe9f8f9b
33 changed files with 1021 additions and 738 deletions

View file

@ -55,7 +55,7 @@ outline = { package = "outline2", path = "../outline2" }
project = { package = "project2", path = "../project2" }
project_panel = { package = "project_panel2", path = "../project_panel2" }
# project_symbols = { path = "../project_symbols" }
# quick_action_bar = { path = "../quick_action_bar" }
quick_action_bar = { package = "quick_action_bar2", path = "../quick_action_bar2" }
# recent_projects = { path = "../recent_projects" }
rope = { package = "rope2", path = "../rope2"}
rpc = { package = "rpc2", path = "../rpc2" }

View file

@ -22,6 +22,7 @@ pub use open_listener::*;
use anyhow::{anyhow, Context as _};
use futures::{channel::mpsc, StreamExt};
use project_panel::ProjectPanel;
use quick_action_bar::QuickActionBar;
use settings::{initial_local_settings_content, load_default_keymap, KeymapFile, Settings};
use std::{borrow::Cow, ops::Deref, sync::Arc};
use terminal_view::terminal_panel::TerminalPanel;
@ -103,11 +104,10 @@ pub fn initialize_workspace(app_state: Arc<AppState>, cx: &mut AppContext) {
toolbar.add_item(breadcrumbs, cx);
let buffer_search_bar = cx.build_view(search::BufferSearchBar::new);
toolbar.add_item(buffer_search_bar.clone(), cx);
// todo!()
// let quick_action_bar = cx.add_view(|_| {
// QuickActionBar::new(buffer_search_bar, workspace)
// });
// toolbar.add_item(quick_action_bar, cx);
let quick_action_bar = cx
.build_view(|_| QuickActionBar::new(buffer_search_bar, workspace));
toolbar.add_item(quick_action_bar, cx);
let diagnostic_editor_controls =
cx.build_view(|_| diagnostics::ToolbarControls::new());
// toolbar.add_item(diagnostic_editor_controls, cx);
@ -171,9 +171,7 @@ pub fn initialize_workspace(app_state: Arc<AppState>, cx: &mut AppContext) {
cx.on_window_should_close(move |cx| {
handle
.update(cx, |workspace, cx| {
if let Some(task) = workspace.close(&Default::default(), cx) {
task.detach_and_log_err(cx);
}
workspace.close_window(&Default::default(), cx);
false
})
.unwrap_or(true)