mirror of
https://github.com/denisidoro/navi
synced 2024-11-22 03:23:05 +00:00
Change default widths (#506)
This commit is contained in:
parent
1c9ffde3ec
commit
d5d939bc96
1 changed files with 3 additions and 3 deletions
|
@ -22,8 +22,8 @@ lazy_static! {
|
||||||
pub static ref TAG_COLOR: Color = parse_ansi(env_var::TAG_COLOR, Color::Cyan);
|
pub static ref TAG_COLOR: Color = parse_ansi(env_var::TAG_COLOR, Color::Cyan);
|
||||||
pub static ref COMMENT_COLOR: Color = parse_ansi(env_var::COMMENT_COLOR, Color::Blue);
|
pub static ref COMMENT_COLOR: Color = parse_ansi(env_var::COMMENT_COLOR, Color::Blue);
|
||||||
pub static ref SNIPPET_COLOR: Color = parse_ansi(env_var::SNIPPET_COLOR, Color::White);
|
pub static ref SNIPPET_COLOR: Color = parse_ansi(env_var::SNIPPET_COLOR, Color::White);
|
||||||
pub static ref TAG_WIDTH_PERCENTAGE: u16 = env_var::parse(env_var::TAG_WIDTH).unwrap_or(27);
|
pub static ref TAG_WIDTH_PERCENTAGE: u16 = env_var::parse(env_var::TAG_WIDTH).unwrap_or(26);
|
||||||
pub static ref COMMENT_WIDTH_PERCENTAGE: u16 = env_var::parse(env_var::COMMENT_WIDTH).unwrap_or(43);
|
pub static ref COMMENT_WIDTH_PERCENTAGE: u16 = env_var::parse(env_var::COMMENT_WIDTH).unwrap_or(42);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn preview(comment: &str, tags: &str, snippet: &str) {
|
pub fn preview(comment: &str, tags: &str, snippet: &str) {
|
||||||
|
@ -124,7 +124,7 @@ fn limit_str(text: &str, length: usize) -> String {
|
||||||
fn get_widths() -> (usize, usize) {
|
fn get_widths() -> (usize, usize) {
|
||||||
let width = terminal::width();
|
let width = terminal::width();
|
||||||
let tag_width = max(20, width * *TAG_WIDTH_PERCENTAGE / 100);
|
let tag_width = max(20, width * *TAG_WIDTH_PERCENTAGE / 100);
|
||||||
let comment_width = max(60, width * *COMMENT_WIDTH_PERCENTAGE / 100);
|
let comment_width = max(45, width * *COMMENT_WIDTH_PERCENTAGE / 100);
|
||||||
(usize::from(tag_width), usize::from(comment_width))
|
(usize::from(tag_width), usize::from(comment_width))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue