Skip to content

Commit

Permalink
Adjust for bufferline
Browse files Browse the repository at this point in the history
  • Loading branch information
pathwave committed Jan 29, 2023
1 parent 690597e commit 3d18e13
Showing 1 changed file with 19 additions and 8 deletions.
27 changes: 19 additions & 8 deletions helix-term/src/ui/editor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,12 @@ impl EditorView {
matches,
line_map: _,
} => {
self.render_document_names(surface, &area, view.offset, matches);
inner = area.clip_bottom(match config.bufferline {
helix_view::editor::BufferLine::Always => 0,
helix_view::editor::BufferLine::Multiple if editor.documents.len() > 1 => 0,
_ => 1,
});
self.render_document_names(surface, &inner, view.offset, matches);
inner = area.clip_left(REFACTOR_NAME_WIDTH).clip_bottom(1);
}
}
Expand Down Expand Up @@ -735,13 +740,19 @@ impl EditorView {
let current_doc = view!(editor).doc;

for doc in editor.documents() {
let fname = doc
.path()
.unwrap_or(&scratch)
.file_name()
.unwrap_or_default()
.to_str()
.unwrap_or_default();
let fname = match &doc.document_type {
helix_view::document::DocumentType::File => doc
.path()
.unwrap_or(&scratch)
.file_name()
.unwrap_or_default()
.to_str()
.unwrap_or_default(),
helix_view::document::DocumentType::Refactor {
matches: _,
line_map: _,
} => helix_view::document::REFACTOR_BUFFER_NAME,
};

let style = if current_doc == doc.id() {
bufferline_active
Expand Down

0 comments on commit 3d18e13

Please sign in to comment.