summaryrefslogtreecommitdiffstats
path: root/src/main.rs
diff options
context:
space:
mode:
authorDan Davison <dandavison7@gmail.com>2020-05-27 15:26:08 -0400
committerDan Davison <dandavison7@gmail.com>2020-05-27 15:58:47 -0400
commit284392c7580e082070e0b9c05d712da65d52c943 (patch)
tree798df4207d09aa1d600345c9a455e579d9364ddc /src/main.rs
parent327792f4bc67d05d03785fe127df9990d2ffce37 (diff)
Refactor: Create color and theme modules, consolidate style code
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/main.rs b/src/main.rs
index ca0197c4..cb4a96d9 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -4,6 +4,7 @@ extern crate error_chain;
mod align;
mod bat;
mod cli;
+mod color;
mod config;
mod delta;
mod draw;
@@ -15,6 +16,7 @@ mod rewrite;
mod style;
mod syntect_color;
mod tests;
+mod theme;
use std::io::{self, ErrorKind, Read, Write};
use std::process;
@@ -128,7 +130,7 @@ index f38589a..0f1bb83 100644
let assets = HighlightingAssets::new();
for (theme, _) in assets.theme_set.themes.iter() {
- if opt.light && !style::is_light_theme(theme) || opt.dark && style::is_light_theme(theme) {
+ if opt.light && !theme::is_light_theme(theme) || opt.dark && theme::is_light_theme(theme) {
continue;
}
@@ -164,13 +166,13 @@ pub fn list_theme_names() -> std::io::Result<()> {
writeln!(stdout, "Light themes:")?;
for (theme, _) in themes.iter() {
- if style::is_light_theme(theme) {
+ if theme::is_light_theme(theme) {
writeln!(stdout, " {}", theme)?;
}
}
writeln!(stdout, "Dark themes:")?;
for (theme, _) in themes.iter() {
- if !style::is_light_theme(theme) {
+ if !theme::is_light_theme(theme) {
writeln!(stdout, " {}", theme)?;
}
}