project: Be explicit about project-searchability for buffers (#37773)
Closes https://github.com/zed-industries/zed/issues/28830 Release Notes: - Fixed builtin buffers and log views showing up in project search
This commit is contained in:
@@ -2619,7 +2619,7 @@ impl Editor {
|
||||
cx: &mut Context<Workspace>,
|
||||
) -> Task<Result<Entity<Editor>>> {
|
||||
let project = workspace.project().clone();
|
||||
let create = project.update(cx, |project, cx| project.create_buffer(cx));
|
||||
let create = project.update(cx, |project, cx| project.create_buffer(true, cx));
|
||||
|
||||
cx.spawn_in(window, async move |workspace, cx| {
|
||||
let buffer = create.await?;
|
||||
@@ -2657,7 +2657,7 @@ impl Editor {
|
||||
cx: &mut Context<Workspace>,
|
||||
) {
|
||||
let project = workspace.project().clone();
|
||||
let create = project.update(cx, |project, cx| project.create_buffer(cx));
|
||||
let create = project.update(cx, |project, cx| project.create_buffer(true, cx));
|
||||
|
||||
cx.spawn_in(window, async move |workspace, cx| {
|
||||
let buffer = create.await?;
|
||||
|
||||
@@ -15913,7 +15913,7 @@ async fn test_following(cx: &mut TestAppContext) {
|
||||
let project = Project::test(fs, ["/file.rs".as_ref()], cx).await;
|
||||
|
||||
let buffer = project.update(cx, |project, cx| {
|
||||
let buffer = project.create_local_buffer(&sample_text(16, 8, 'a'), None, cx);
|
||||
let buffer = project.create_local_buffer(&sample_text(16, 8, 'a'), None, false, cx);
|
||||
cx.new(|cx| MultiBuffer::singleton(buffer, cx))
|
||||
});
|
||||
let leader = cx.add_window(|window, cx| build_editor(buffer.clone(), window, cx));
|
||||
@@ -16165,8 +16165,8 @@ async fn test_following_with_multiple_excerpts(cx: &mut TestAppContext) {
|
||||
|
||||
let (buffer_1, buffer_2) = project.update(cx, |project, cx| {
|
||||
(
|
||||
project.create_local_buffer("abc\ndef\nghi\njkl\n", None, cx),
|
||||
project.create_local_buffer("mno\npqr\nstu\nvwx\n", None, cx),
|
||||
project.create_local_buffer("abc\ndef\nghi\njkl\n", None, false, cx),
|
||||
project.create_local_buffer("mno\npqr\nstu\nvwx\n", None, false, cx),
|
||||
)
|
||||
});
|
||||
|
||||
|
||||
@@ -1130,7 +1130,7 @@ impl SerializableItem for Editor {
|
||||
|
||||
// First create the empty buffer
|
||||
let buffer = project
|
||||
.update(cx, |project, cx| project.create_buffer(cx))?
|
||||
.update(cx, |project, cx| project.create_buffer(true, cx))?
|
||||
.await?;
|
||||
|
||||
// Then set the text so that the dirty bit is set correctly
|
||||
@@ -1238,7 +1238,7 @@ impl SerializableItem for Editor {
|
||||
..
|
||||
} => window.spawn(cx, async move |cx| {
|
||||
let buffer = project
|
||||
.update(cx, |project, cx| project.create_buffer(cx))?
|
||||
.update(cx, |project, cx| project.create_buffer(true, cx))?
|
||||
.await?;
|
||||
|
||||
cx.update(|window, cx| {
|
||||
|
||||
@@ -200,7 +200,7 @@ pub fn expand_macro_recursively(
|
||||
}
|
||||
|
||||
let buffer = project
|
||||
.update(cx, |project, cx| project.create_buffer(cx))?
|
||||
.update(cx, |project, cx| project.create_buffer(false, cx))?
|
||||
.await?;
|
||||
workspace.update_in(cx, |workspace, window, cx| {
|
||||
buffer.update(cx, |buffer, cx| {
|
||||
|
||||
Reference in New Issue
Block a user