mirror of
https://github.com/helix-editor/helix.git
synced 2024-11-23 01:46:18 +04:00
fix clippy errs
This commit is contained in:
parent
c7879578ac
commit
de3f5516e1
@ -29,7 +29,7 @@
|
||||
keyboard::{KeyCode, KeyModifiers},
|
||||
Document, Editor, Theme, View,
|
||||
};
|
||||
use std::{mem::take, num::NonZeroUsize, path::PathBuf, rc::Rc, sync::Arc};
|
||||
use std::{cmp::Ordering, mem::take, num::NonZeroUsize, path::PathBuf, rc::Rc, sync::Arc};
|
||||
|
||||
use tui::{buffer::Buffer as Surface, text::Span};
|
||||
|
||||
@ -570,13 +570,17 @@ pub fn render_bufferline(editor: &Editor, viewport: Rect, surface: &mut Surface)
|
||||
for (idx, filename) in entries.iter().enumerate() {
|
||||
let mut text = filename.as_str();
|
||||
if to_trim > 0 {
|
||||
if text.len() > to_trim {
|
||||
match to_trim.cmp(&text.len()) {
|
||||
Ordering::Less => {
|
||||
text = &filename[to_trim..];
|
||||
to_trim = 0;
|
||||
} else if to_trim > text.len() {
|
||||
}
|
||||
Ordering::Greater => {
|
||||
to_trim -= text.len();
|
||||
continue;
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
let style = if idx == current_doc_idx.unwrap() {
|
||||
bufferline_active
|
||||
|
Loading…
Reference in New Issue
Block a user