close #40
This commit is contained in:
@@ -1,13 +1,25 @@
|
|||||||
use std::{
|
use std::{
|
||||||
cmp::{max, min}, collections::HashMap, io, path::PathBuf
|
cmp::{max, min},
|
||||||
|
collections::HashMap,
|
||||||
|
io,
|
||||||
|
path::PathBuf,
|
||||||
};
|
};
|
||||||
|
|
||||||
use ratatui::{
|
use ratatui::{
|
||||||
DefaultTerminal, Frame, crossterm::event, layout::{self, Constraint, Layout, Rect}, prelude, style::{Color, Modifier, Style}, widgets::{Paragraph, Widget}
|
DefaultTerminal, Frame,
|
||||||
|
crossterm::event,
|
||||||
|
layout::{self, Constraint, Layout, Rect},
|
||||||
|
prelude,
|
||||||
|
style::{Color, Modifier, Style},
|
||||||
|
widgets::{Paragraph, Widget},
|
||||||
};
|
};
|
||||||
|
|
||||||
use crate::app::{
|
use crate::app::{
|
||||||
clipboard::Clipboard, error_msg::StatusMessage, logic::{calc::Grid, cell::CellType}, mode::Mode, screen::ScreenSpace
|
clipboard::Clipboard,
|
||||||
|
error_msg::StatusMessage,
|
||||||
|
logic::{calc::Grid, cell::CellType},
|
||||||
|
mode::Mode,
|
||||||
|
screen::ScreenSpace,
|
||||||
};
|
};
|
||||||
|
|
||||||
pub struct App {
|
pub struct App {
|
||||||
@@ -144,6 +156,13 @@ impl Widget for &App {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if let Some(bound) = suggest_upper_bound {
|
||||||
|
let bound = bound as usize;
|
||||||
|
if bound < display.len() {
|
||||||
|
display.truncate(bound - 2);
|
||||||
|
display.push('…');
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
None => should_render = false,
|
None => should_render = false,
|
||||||
}
|
}
|
||||||
@@ -246,7 +265,12 @@ impl App {
|
|||||||
|
|
||||||
let cmd_line_split = Layout::default()
|
let cmd_line_split = Layout::default()
|
||||||
.direction(layout::Direction::Horizontal)
|
.direction(layout::Direction::Horizontal)
|
||||||
.constraints([Constraint::Length(len), Constraint::Length(file_name_status.len() as u16 + 1), Constraint::Percentage(50), Constraint::Percentage(50)])
|
.constraints([
|
||||||
|
Constraint::Length(len),
|
||||||
|
Constraint::Length(file_name_status.len() as u16 + 1),
|
||||||
|
Constraint::Percentage(50),
|
||||||
|
Constraint::Percentage(50),
|
||||||
|
])
|
||||||
.split(cmd_line);
|
.split(cmd_line);
|
||||||
|
|
||||||
let cmd_line_left = cmd_line_split[0];
|
let cmd_line_left = cmd_line_split[0];
|
||||||
|
|||||||
Reference in New Issue
Block a user