From b3fe950ea23eab1bf278030c48e5ca9c747eded9 Mon Sep 17 00:00:00 2001 From: Jinzhou Zhang Date: Fri, 2 Aug 2019 22:04:30 +0800 Subject: [PATCH] fix #207 color config not working for header --- src/header.rs | 5 +++++ src/model.rs | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/header.rs b/src/header.rs index c68d67d9..54e0734e 100644 --- a/src/header.rs +++ b/src/header.rs @@ -39,6 +39,11 @@ impl Header { self } + pub fn theme(mut self, theme: Arc) -> Self { + self.theme = theme; + self + } + pub fn with_options(mut self, options: &SkimOptions) -> Self { if let Some(tabstop_str) = options.tabstop { let tabstop = tabstop_str.parse::().unwrap_or(8); diff --git a/src/model.rs b/src/model.rs index ee18219a..ca035e2d 100644 --- a/src/model.rs +++ b/src/model.rs @@ -92,7 +92,10 @@ impl Model { let selection = Selection::with_options(options).theme(theme.clone()); let matcher = Matcher::with_options(options); let item_pool = Arc::new(ItemPool::new().lines_to_reserve(options.header_lines)); - let header = Header::empty().with_options(options).item_pool(item_pool.clone()); + let header = Header::empty() + .with_options(options) + .item_pool(item_pool.clone()) + .theme(theme.clone()); let margins = options .margin