Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hide multi-buffer expand indicators at start/end of file #25371

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions crates/assistant/src/inline_assistant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1248,7 +1248,7 @@ impl InlineAssistant {
});

enum DeletedLines {}
let mut editor = Editor::for_multibuffer(multi_buffer, None, true, window, cx);
let mut editor = Editor::for_multibuffer(multi_buffer, None, window, cx);
editor.set_soft_wrap_mode(language::language_settings::SoftWrap::None, cx);
editor.set_show_wrap_guides(false, cx);
editor.set_show_gutter(false, cx);
Expand Down Expand Up @@ -1696,7 +1696,6 @@ impl PromptEditor {
},
prompt_buffer,
None,
false,
window,
cx,
);
Expand Down
1 change: 0 additions & 1 deletion crates/assistant/src/terminal_inline_assistant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,6 @@ impl PromptEditor {
},
prompt_buffer,
None,
false,
window,
cx,
);
Expand Down
2 changes: 1 addition & 1 deletion crates/assistant2/src/inline_assistant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1342,7 +1342,7 @@ impl InlineAssistant {
});

enum DeletedLines {}
let mut editor = Editor::for_multibuffer(multi_buffer, None, true, window, cx);
let mut editor = Editor::for_multibuffer(multi_buffer, None, window, cx);
editor.set_soft_wrap_mode(language::language_settings::SoftWrap::None, cx);
editor.set_show_wrap_guides(false, cx);
editor.set_show_gutter(false, cx);
Expand Down
2 changes: 0 additions & 2 deletions crates/assistant2/src/inline_prompt_editor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -851,7 +851,6 @@ impl PromptEditor<BufferCodegen> {
},
prompt_buffer,
None,
false,
window,
cx,
);
Expand Down Expand Up @@ -1011,7 +1010,6 @@ impl PromptEditor<TerminalCodegen> {
},
prompt_buffer,
None,
false,
window,
cx,
);
Expand Down
2 changes: 1 addition & 1 deletion crates/auto_update_ui/src/auto_update_ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ fn view_release_notes_locally(

let tab_description = SharedString::from(body.title.to_string());
let editor = cx.new(|cx| {
Editor::for_multibuffer(buffer, Some(project), true, window, cx)
Editor::for_multibuffer(buffer, Some(project), window, cx)
});
let workspace_handle = workspace.weak_handle();
let markdown_preview: Entity<MarkdownPreviewView> =
Expand Down
5 changes: 2 additions & 3 deletions crates/collab/src/tests/following_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -313,9 +313,8 @@ async fn test_basic_following(
result
});
let multibuffer_editor_a = workspace_a.update_in(cx_a, |workspace, window, cx| {
let editor = cx.new(|cx| {
Editor::for_multibuffer(multibuffer_a, Some(project_a.clone()), true, window, cx)
});
let editor = cx
.new(|cx| Editor::for_multibuffer(multibuffer_a, Some(project_a.clone()), window, cx));
workspace.add_item_to_active_pane(Box::new(editor.clone()), None, true, window, cx);
editor
});
Expand Down
8 changes: 4 additions & 4 deletions crates/copilot/src/copilot_completion_provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -730,8 +730,8 @@ mod tests {
);
multibuffer
});
let editor = cx
.add_window(|window, cx| Editor::for_multibuffer(multibuffer, None, true, window, cx));
let editor =
cx.add_window(|window, cx| Editor::for_multibuffer(multibuffer, None, window, cx));
editor
.update(cx, |editor, window, cx| {
use gpui::Focusable;
Expand Down Expand Up @@ -982,8 +982,8 @@ mod tests {
);
multibuffer
});
let editor = cx
.add_window(|window, cx| Editor::for_multibuffer(multibuffer, None, true, window, cx));
let editor =
cx.add_window(|window, cx| Editor::for_multibuffer(multibuffer, None, window, cx));
editor
.update(cx, |editor, window, cx| {
use gpui::Focusable;
Expand Down
9 changes: 2 additions & 7 deletions crates/diagnostics/src/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,13 +167,8 @@ impl ProjectDiagnosticsEditor {

let excerpts = cx.new(|cx| MultiBuffer::new(project_handle.read(cx).capability()));
let editor = cx.new(|cx| {
let mut editor = Editor::for_multibuffer(
excerpts.clone(),
Some(project_handle.clone()),
true,
window,
cx,
);
let mut editor =
Editor::for_multibuffer(excerpts.clone(), Some(project_handle.clone()), window, cx);
editor.set_vertical_scroll_margin(5, cx);
editor.disable_inline_diagnostics();
editor
Expand Down
22 changes: 0 additions & 22 deletions crates/editor/src/display_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ impl DisplayMap {
font: Font,
font_size: Pixels,
wrap_width: Option<Pixels>,
show_excerpt_controls: bool,
buffer_header_height: u32,
excerpt_header_height: u32,
excerpt_footer_height: u32,
Expand All @@ -137,7 +136,6 @@ impl DisplayMap {
let (wrap_map, snapshot) = WrapMap::new(snapshot, font, font_size, wrap_width, cx);
let block_map = BlockMap::new(
snapshot,
show_excerpt_controls,
buffer_header_height,
excerpt_header_height,
excerpt_footer_height,
Expand Down Expand Up @@ -548,10 +546,6 @@ impl DisplayMap {
pub fn is_rewrapping(&self, cx: &gpui::App) -> bool {
self.wrap_map.read(cx).is_rewrapping()
}

pub fn show_excerpt_controls(&self) -> bool {
self.block_map.show_excerpt_controls()
}
}

#[derive(Debug, Default)]
Expand Down Expand Up @@ -1285,10 +1279,6 @@ impl DisplaySnapshot {
self.inlay_highlights.get(&type_id)
}

pub fn buffer_header_height(&self) -> u32 {
self.block_snapshot.buffer_header_height
}

pub fn excerpt_footer_height(&self) -> u32 {
self.block_snapshot.excerpt_footer_height
}
Expand Down Expand Up @@ -1502,7 +1492,6 @@ pub mod tests {
font,
font_size,
wrap_width,
true,
buffer_start_excerpt_header_height,
excerpt_header_height,
0,
Expand Down Expand Up @@ -1752,7 +1741,6 @@ pub mod tests {
font("Helvetica"),
font_size,
wrap_width,
true,
1,
1,
0,
Expand Down Expand Up @@ -1863,7 +1851,6 @@ pub mod tests {
font("Helvetica"),
font_size,
None,
true,
1,
1,
0,
Expand Down Expand Up @@ -1959,7 +1946,6 @@ pub mod tests {
font("Helvetica"),
font_size,
None,
true,
1,
1,
1,
Expand Down Expand Up @@ -2061,7 +2047,6 @@ pub mod tests {
font("Courier"),
px(16.0),
None,
true,
1,
1,
0,
Expand Down Expand Up @@ -2166,7 +2151,6 @@ pub mod tests {
font("Courier"),
px(16.0),
None,
true,
1,
1,
0,
Expand Down Expand Up @@ -2255,7 +2239,6 @@ pub mod tests {
font("Courier"),
px(16.0),
None,
true,
1,
1,
0,
Expand Down Expand Up @@ -2399,7 +2382,6 @@ pub mod tests {
font("Courier"),
font_size,
Some(px(40.0)),
true,
1,
1,
0,
Expand Down Expand Up @@ -2483,7 +2465,6 @@ pub mod tests {
font("Courier"),
font_size,
None,
true,
1,
1,
1,
Expand Down Expand Up @@ -2609,7 +2590,6 @@ pub mod tests {
font("Helvetica"),
font_size,
None,
true,
1,
1,
0,
Expand Down Expand Up @@ -2648,7 +2628,6 @@ pub mod tests {
font("Helvetica"),
font_size,
None,
true,
1,
1,
0,
Expand Down Expand Up @@ -2725,7 +2704,6 @@ pub mod tests {
font("Helvetica"),
font_size,
None,
true,
1,
1,
0,
Expand Down
Loading
Loading