|
|
@ -29,7 +29,7 @@ use helix_view::{
|
|
|
|
keyboard::{KeyCode, KeyModifiers},
|
|
|
|
keyboard::{KeyCode, KeyModifiers},
|
|
|
|
Document, Editor, Theme, View,
|
|
|
|
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};
|
|
|
|
use tui::{buffer::Buffer as Surface, text::Span};
|
|
|
|
|
|
|
|
|
|
|
@ -570,12 +570,16 @@ impl EditorView {
|
|
|
|
for (idx, filename) in entries.iter().enumerate() {
|
|
|
|
for (idx, filename) in entries.iter().enumerate() {
|
|
|
|
let mut text = filename.as_str();
|
|
|
|
let mut text = filename.as_str();
|
|
|
|
if to_trim > 0 {
|
|
|
|
if to_trim > 0 {
|
|
|
|
if text.len() > to_trim {
|
|
|
|
match to_trim.cmp(&text.len()) {
|
|
|
|
text = &filename[to_trim..];
|
|
|
|
Ordering::Less => {
|
|
|
|
to_trim = 0;
|
|
|
|
text = &filename[to_trim..];
|
|
|
|
} else if to_trim > text.len() {
|
|
|
|
to_trim = 0;
|
|
|
|
to_trim -= text.len();
|
|
|
|
}
|
|
|
|
continue;
|
|
|
|
Ordering::Greater => {
|
|
|
|
|
|
|
|
to_trim -= text.len();
|
|
|
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
_ => {}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
let style = if idx == current_doc_idx.unwrap() {
|
|
|
|
let style = if idx == current_doc_idx.unwrap() {
|
|
|
|