Skip to content

Commit 3d18e13

Browse files
committed
Adjust for bufferline
1 parent 690597e commit 3d18e13

File tree

1 file changed

+19
-8
lines changed

1 file changed

+19
-8
lines changed

helix-term/src/ui/editor.rs

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,12 @@ impl EditorView {
159159
matches,
160160
line_map: _,
161161
} => {
162-
self.render_document_names(surface, &area, view.offset, matches);
162+
inner = area.clip_bottom(match config.bufferline {
163+
helix_view::editor::BufferLine::Always => 0,
164+
helix_view::editor::BufferLine::Multiple if editor.documents.len() > 1 => 0,
165+
_ => 1,
166+
});
167+
self.render_document_names(surface, &inner, view.offset, matches);
163168
inner = area.clip_left(REFACTOR_NAME_WIDTH).clip_bottom(1);
164169
}
165170
}
@@ -735,13 +740,19 @@ impl EditorView {
735740
let current_doc = view!(editor).doc;
736741

737742
for doc in editor.documents() {
738-
let fname = doc
739-
.path()
740-
.unwrap_or(&scratch)
741-
.file_name()
742-
.unwrap_or_default()
743-
.to_str()
744-
.unwrap_or_default();
743+
let fname = match &doc.document_type {
744+
helix_view::document::DocumentType::File => doc
745+
.path()
746+
.unwrap_or(&scratch)
747+
.file_name()
748+
.unwrap_or_default()
749+
.to_str()
750+
.unwrap_or_default(),
751+
helix_view::document::DocumentType::Refactor {
752+
matches: _,
753+
line_map: _,
754+
} => helix_view::document::REFACTOR_BUFFER_NAME,
755+
};
745756

746757
let style = if current_doc == doc.id() {
747758
bufferline_active

0 commit comments

Comments
 (0)