mirror of
https://github.com/TECHNOFAB11/tmux-copyrat.git
synced 2025-12-12 16:10:07 +01:00
refactor: colors.rs -> ui/colors.rs
This commit is contained in:
parent
d119ce6b0d
commit
748da3ae72
4 changed files with 11 additions and 9 deletions
15
src/lib.rs
15
src/lib.rs
|
|
@ -4,7 +4,6 @@ use std::path;
|
|||
use std::str::FromStr;
|
||||
|
||||
pub mod alphabets;
|
||||
pub mod colors;
|
||||
pub mod error;
|
||||
pub mod model;
|
||||
pub mod output_destination;
|
||||
|
|
@ -98,7 +97,7 @@ pub struct CliOpt {
|
|||
unique_hint: bool,
|
||||
|
||||
#[clap(flatten)]
|
||||
colors: colors::UiColors,
|
||||
colors: ui::colors::UiColors,
|
||||
|
||||
/// Align hint with its match.
|
||||
#[clap(long, arg_enum, default_value = "leading")]
|
||||
|
|
@ -187,12 +186,12 @@ impl CliOpt {
|
|||
self.unique_hint = value.parse::<bool>()?;
|
||||
}
|
||||
|
||||
"@copyrat-match-fg" => self.colors.match_fg = colors::parse_color(value)?,
|
||||
"@copyrat-match-bg" => self.colors.match_bg = colors::parse_color(value)?,
|
||||
"@copyrat-focused-fg" => self.colors.focused_fg = colors::parse_color(value)?,
|
||||
"@copyrat-focused-bg" => self.colors.focused_bg = colors::parse_color(value)?,
|
||||
"@copyrat-hint-fg" => self.colors.hint_fg = colors::parse_color(value)?,
|
||||
"@copyrat-hint-bg" => self.colors.hint_bg = colors::parse_color(value)?,
|
||||
"@copyrat-match-fg" => self.colors.match_fg = ui::colors::parse_color(value)?,
|
||||
"@copyrat-match-bg" => self.colors.match_bg = ui::colors::parse_color(value)?,
|
||||
"@copyrat-focused-fg" => self.colors.focused_fg = ui::colors::parse_color(value)?,
|
||||
"@copyrat-focused-bg" => self.colors.focused_bg = ui::colors::parse_color(value)?,
|
||||
"@copyrat-hint-fg" => self.colors.hint_fg = ui::colors::parse_color(value)?,
|
||||
"@copyrat-hint-bg" => self.colors.hint_bg = ui::colors::parse_color(value)?,
|
||||
|
||||
"@copyrat-hint-alignment" => {
|
||||
self.hint_alignment = ui::HintAlignment::from_str(&value)?
|
||||
|
|
|
|||
|
|
@ -17,6 +17,8 @@
|
|||
//! - toggle the output destination (tmux buffer or clipboard)
|
||||
//!
|
||||
|
||||
pub mod colors;
|
||||
mod vc;
|
||||
|
||||
pub use vc::ViewController;
|
||||
pub use vc::{HintAlignment, HintStyle};
|
||||
|
|
|
|||
|
|
@ -7,8 +7,9 @@ use clap::Clap;
|
|||
use sequence_trie::SequenceTrie;
|
||||
use termion::{self, color, cursor, event, style};
|
||||
|
||||
use super::colors::UiColors;
|
||||
use crate::error::ParseError;
|
||||
use crate::{colors::UiColors, model, output_destination::OutputDestination, selection::Selection};
|
||||
use crate::{model, output_destination::OutputDestination, selection::Selection};
|
||||
|
||||
pub struct ViewController<'a> {
|
||||
model: &'a mut model::Model<'a>,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue