Get app menus basically working

- Everything is still disabled when there is no active window.

Co-Authored-By: Marshall <marshall@zed.dev>
This commit is contained in:
Nathan Sobo
2023-12-05 16:37:01 -07:00
co-authored by Marshall
parent 79567d1c87
commit 82534b6612
13 changed files with 437 additions and 229 deletions
+2 -6
View File
@@ -993,7 +993,7 @@ mod tests {
use super::*;
use crate::display_map::inlay_map::InlayMap;
use crate::display_map::{fold_map::FoldMap, tab_map::TabMap, wrap_map::WrapMap};
use gpui::{div, font, px, Element, Platform as _};
use gpui::{div, font, px, Element};
use multi_buffer::MultiBuffer;
use rand::prelude::*;
use settings::SettingsStore;
@@ -1185,11 +1185,7 @@ mod tests {
fn test_blocks_on_wrapped_lines(cx: &mut gpui::TestAppContext) {
cx.update(|cx| init_test(cx));
let font_id = cx
.test_platform
.text_system()
.font_id(&font("Helvetica"))
.unwrap();
let font_id = cx.text_system().font_id(&font("Helvetica")).unwrap();
let text = "one two three\nfour five six\nseven eight";
+1 -1
View File
@@ -1032,7 +1032,7 @@ mod tests {
display_map::{fold_map::FoldMap, inlay_map::InlayMap, tab_map::TabMap},
MultiBuffer,
};
use gpui::{font, px, test::observe, Platform};
use gpui::{font, px, test::observe};
use rand::prelude::*;
use settings::SettingsStore;
use smol::stream::StreamExt;
+2 -4
View File
@@ -12,7 +12,7 @@ use futures::StreamExt;
use gpui::{
div,
serde_json::{self, json},
Div, Flatten, Platform, TestAppContext, VisualTestContext, WindowBounds, WindowOptions,
Div, Flatten, TestAppContext, VisualTestContext, WindowBounds, WindowOptions,
};
use indoc::indoc;
use language::{
@@ -3238,9 +3238,7 @@ async fn test_clipboard(cx: &mut gpui::TestAppContext) {
the lazy dog"});
cx.update_editor(|e, cx| e.copy(&Copy, cx));
assert_eq!(
cx.test_platform
.read_from_clipboard()
.map(|item| item.text().to_owned()),
cx.read_from_clipboard().map(|item| item.text().to_owned()),
Some("fox jumps over\n".to_owned())
);