chore: update to clap v4 & termion v2

This commit is contained in:
graelo 2022-11-07 00:02:27 +01:00
parent 1f79419934
commit 10013a6c6d
9 changed files with 282 additions and 196 deletions

View file

@ -1,29 +1,79 @@
use clap::Parser;
use termion::color;
use std::fmt;
use std::str::FromStr;
use clap::Args;
use termion::color as tcolor;
use crate::{Error, Result};
pub fn parse_color(src: &str) -> Result<Box<dyn color::Color>> {
match src {
"black" => Ok(Box::new(color::Black)),
"red" => Ok(Box::new(color::Red)),
"green" => Ok(Box::new(color::Green)),
"yellow" => Ok(Box::new(color::Yellow)),
"blue" => Ok(Box::new(color::Blue)),
"magenta" => Ok(Box::new(color::Magenta)),
"cyan" => Ok(Box::new(color::Cyan)),
"white" => Ok(Box::new(color::White)),
"bright-black" | "brightblack" => Ok(Box::new(color::LightBlack)),
"bright-red" | "brightred" => Ok(Box::new(color::LightRed)),
"bright-green" | "brightgreen" => Ok(Box::new(color::LightGreen)),
"bright-yellow" | "brightyellow" => Ok(Box::new(color::LightYellow)),
"bright-blue" | "brightblue" => Ok(Box::new(color::LightBlue)),
"bright-magenta" | "brightmagenta" => Ok(Box::new(color::LightMagenta)),
"bright-cyan" | "brightcyan" => Ok(Box::new(color::LightCyan)),
"bright-white" | "brightwhite" => Ok(Box::new(color::LightWhite)),
"none" => Ok(Box::new(color::Reset)),
_ => Err(Error::UnknownColor),
#[derive(Debug, Clone, Copy)]
pub struct Color(Option<u8>);
impl tcolor::Color for Color {
#[inline]
fn write_fg(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self.0 {
Some(value) => write!(f, "\x1B[38;5;{}m", value),
None => write!(f, "\x1B[39m"),
}
}
#[inline]
fn write_bg(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self.0 {
Some(value) => write!(f, "\x1B[48;5;{}m", value),
None => write!(f, "\x1B[49m"),
}
}
}
pub(crate) static BLACK: Color = Color(Some(0));
pub(crate) static RED: Color = Color(Some(1));
pub(crate) static GREEN: Color = Color(Some(2));
pub(crate) static YELLOW: Color = Color(Some(3));
pub(crate) static BLUE: Color = Color(Some(4));
pub(crate) static MAGENTA: Color = Color(Some(5));
pub(crate) static CYAN: Color = Color(Some(6));
pub(crate) static WHITE: Color = Color(Some(7));
pub(crate) static BRIGHTBLACK: Color = Color(Some(8));
pub(crate) static BRIGHTRED: Color = Color(Some(9));
pub(crate) static BRIGHTGREEN: Color = Color(Some(10));
pub(crate) static BRIGHTYELLOW: Color = Color(Some(11));
pub(crate) static BRIGHTBLUE: Color = Color(Some(12));
pub(crate) static BRIGHTMAGENTA: Color = Color(Some(13));
pub(crate) static BRIGHTCYAN: Color = Color(Some(14));
pub(crate) static BRIGHTWHITE: Color = Color(Some(15));
pub(crate) static RESET: Color = Color(None);
impl FromStr for Color {
type Err = Error;
fn from_str(src: &str) -> std::result::Result<Self, Self::Err> {
match src {
"black" => Ok(BLACK),
"red" => Ok(RED),
"green" => Ok(GREEN),
"yellow" => Ok(YELLOW),
"blue" => Ok(BLUE),
"magenta" => Ok(MAGENTA),
"cyan" => Ok(CYAN),
"white" => Ok(WHITE),
"bright-black" | "brightblack" => Ok(BRIGHTBLACK),
"bright-red" | "brightred" => Ok(BRIGHTRED),
"bright-green" | "brightgreen" => Ok(BRIGHTGREEN),
"bright-yellow" | "brightyellow" => Ok(BRIGHTYELLOW),
"bright-blue" | "brightblue" => Ok(BRIGHTBLUE),
"bright-magenta" | "brightmagenta" => Ok(BRIGHTMAGENTA),
"bright-cyan" | "brightcyan" => Ok(BRIGHTCYAN),
"bright-white" | "brightwhite" => Ok(BRIGHTWHITE),
"none" => Ok(RESET),
_ => Err(Error::UnknownColor),
}
}
}
pub fn parse_color(src: &str) -> Result<Color> {
Color::from_str(src)
}
#[cfg(test)]
@ -31,20 +81,27 @@ mod tests {
use super::*;
#[test]
fn span_color() {
let text1 = format!(
"{}{}",
color::Fg(parse_color("green").unwrap().as_ref()),
"foo"
);
let text2 = format!("{}{}", color::Fg(color::Green), "foo");
fn span_color_fg() {
let actual = format!("{}{}", tcolor::Fg(Color::from_str("green").unwrap()), "foo");
let expected = format!("{}{}", tcolor::Fg(tcolor::Green), "foo");
assert_eq!(text1, text2);
assert_eq!(actual, expected);
}
#[test]
fn span_color_bg() {
let actual = format!("{}{}", tcolor::Bg(Color::from_str("green").unwrap()), "foo");
let expected = format!("{}{}", tcolor::Bg(tcolor::Green), "foo");
assert_eq!(actual, expected);
}
#[test]
fn no_span_color() {
assert!(parse_color("wat").is_err(), "this color should not exist");
assert!(
Color::from_str("wat").is_err(),
"this color should not exist"
);
}
}
@ -53,44 +110,38 @@ mod tests {
/// - `focus_*` colors are used to render the currently focused text span.
/// - `normal_*` colors are used to render other text spans.
/// - `hint_*` colors are used to render the hints.
#[derive(Parser, Debug)]
#[clap(about)] // Needed to avoid this doc comment to be used as overall `about`.
#[derive(Args, Debug)]
// #[clap(about)] // Needed to avoid this doc comment to be used as overall `about`.
pub struct UiColors {
/// Foreground color for base text.
#[clap(long, default_value = "bright-cyan", parse(try_from_str = parse_color))]
pub text_fg: Box<dyn color::Color>,
#[arg(long, default_value = "bright-cyan", value_parser(parse_color))]
pub text_fg: Color,
/// Background color for base text.
#[clap(long, default_value = "none", parse(try_from_str = parse_color))]
pub text_bg: Box<dyn color::Color>,
#[clap(long, default_value = "none", value_parser(parse_color))]
pub text_bg: Color,
/// Foreground color for spans.
#[clap(long, default_value = "blue",
parse(try_from_str = parse_color))]
pub span_fg: Box<dyn color::Color>,
#[clap(long, default_value = "blue", value_parser(parse_color))]
pub span_fg: Color,
/// Background color for spans.
#[clap(long, default_value = "none",
parse(try_from_str = parse_color))]
pub span_bg: Box<dyn color::Color>,
#[clap(long, default_value = "none", value_parser(parse_color))]
pub span_bg: Color,
/// Foreground color for the focused span.
#[clap(long, default_value = "magenta",
parse(try_from_str = parse_color))]
pub focused_fg: Box<dyn color::Color>,
#[clap(long, default_value = "magenta", value_parser(parse_color))]
pub focused_fg: Color,
/// Background color for the focused span.
#[clap(long, default_value = "none",
parse(try_from_str = parse_color))]
pub focused_bg: Box<dyn color::Color>,
#[clap(long, default_value = "none", value_parser(parse_color))]
pub focused_bg: Color,
/// Foreground color for hints.
#[clap(long, default_value = "yellow",
parse(try_from_str = parse_color))]
pub hint_fg: Box<dyn color::Color>,
#[clap(long, default_value = "yellow", value_parser(parse_color))]
pub hint_fg: Color,
/// Background color for hints.
#[clap(long, default_value = "none",
parse(try_from_str = parse_color))]
pub hint_bg: Box<dyn color::Color>,
#[clap(long, default_value = "none", value_parser(parse_color))]
pub hint_bg: Color,
}

View file

@ -1,8 +1,8 @@
use clap::{ArgEnum, Parser};
use clap::{Parser, ValueEnum};
/// Describes if, during rendering, a hint should aligned to the leading edge of
/// the matched text, or to its trailing edge.
#[derive(Debug, Clone, ArgEnum, Parser)]
#[derive(Debug, Clone, ValueEnum, Parser)]
pub enum HintAlignment {
Leading,
Trailing,

View file

@ -1,8 +1,9 @@
use std::char;
use std::cmp;
use std::io;
use std::io::Write;
use termion::{self, color, cursor, event, style};
use termion::{self, color, cursor, event, screen::IntoAlternateScreen, style};
use super::colors::UiColors;
use super::Selection;
@ -63,7 +64,7 @@ impl<'a> ViewController<'a> {
};
let (term_width, _) = termion::terminal_size().unwrap_or((80u16, 30u16)); // .expect("Cannot read the terminal size.");
let wrapped_lines = compute_wrapped_lines(&model.lines, term_width);
let wrapped_lines = compute_wrapped_lines(model.lines, term_width);
ViewController {
model,
@ -177,8 +178,8 @@ impl<'a> ViewController<'a> {
write!(
stdout,
"{bg_color}{fg_color}",
fg_color = color::Fg(colors.text_fg.as_ref()),
bg_color = color::Bg(colors.text_bg.as_ref()),
fg_color = color::Fg(colors.text_fg),
bg_color = color::Bg(colors.text_bg),
)
.unwrap();
@ -233,8 +234,8 @@ impl<'a> ViewController<'a> {
stdout,
"{goto}{bg_color}{fg_color}{text}{fg_reset}{bg_reset}",
goto = cursor::Goto(pos.0 as u16 + 1, pos.1 as u16 + 1),
fg_color = color::Fg(fg_color.as_ref()),
bg_color = color::Bg(bg_color.as_ref()),
fg_color = color::Fg(*fg_color),
bg_color = color::Bg(*bg_color),
fg_reset = color::Fg(color::Reset),
bg_reset = color::Bg(color::Reset),
text = &text,
@ -260,8 +261,8 @@ impl<'a> ViewController<'a> {
colors: &UiColors,
hint_style: &Option<HintStyle>,
) {
let fg_color = color::Fg(colors.hint_fg.as_ref());
let bg_color = color::Bg(colors.hint_bg.as_ref());
let fg_color = color::Fg(colors.hint_fg);
let bg_color = color::Bg(colors.hint_bg);
let fg_reset = color::Fg(color::Reset);
let bg_reset = color::Bg(color::Reset);
let goto = cursor::Goto(pos.0 as u16 + 1, pos.1 as u16 + 1);
@ -358,7 +359,7 @@ impl<'a> ViewController<'a> {
text,
focused,
(pos_x, pos_y),
&self.rendering_colors,
self.rendering_colors,
);
if !focused {
@ -374,7 +375,7 @@ impl<'a> ViewController<'a> {
stdout,
&span.hint,
(pos_x + offset, pos_y),
&self.rendering_colors,
self.rendering_colors,
&self.hint_style,
);
}
@ -399,9 +400,9 @@ impl<'a> ViewController<'a> {
// 1. Trim all lines and render non-empty ones.
ViewController::render_base_text(
stdout,
&self.model.lines,
self.model.lines,
&self.wrapped_lines,
&self.rendering_colors,
self.rendering_colors,
);
for (index, span) in self.model.spans.iter().enumerate() {
@ -598,17 +599,16 @@ impl<'a> ViewController<'a> {
/// - Setup steps: switch to alternate screen, switch to raw mode, hide the cursor.
/// - Teardown steps: show cursor, back to main screen.
pub fn present(&mut self) -> Option<Selection> {
use std::io::Write;
use termion::raw::IntoRawMode;
use termion::screen::AlternateScreen;
let mut stdin = termion::async_stdin();
let mut stdout = AlternateScreen::from(
io::stdout()
.into_raw_mode()
.expect("Cannot access alternate screen."),
);
let mut stdout = io::stdout()
.into_alternate_screen()
.expect("Cannot access alternate screen.")
.into_raw_mode()
.expect("Cannot access alternate screen.");
// stdout.write(cursor::Hide.into()).unwrap();
write!(stdout, "{}", cursor::Hide).unwrap();
let selection = match self.listen(&mut stdin, &mut stdout) {
@ -663,7 +663,7 @@ enum Event {
#[cfg(test)]
mod tests {
use super::*;
use crate::textbuf::alphabet;
use crate::{textbuf::alphabet, ui::colors};
#[test]
fn test_render_all_lines() {
@ -684,14 +684,14 @@ path: /usr/local/bin/cargo";
];
let colors = UiColors {
text_fg: Box::new(color::Black),
text_bg: Box::new(color::White),
focused_fg: Box::new(color::Red),
focused_bg: Box::new(color::Blue),
span_fg: Box::new(color::Green),
span_bg: Box::new(color::Magenta),
hint_fg: Box::new(color::Yellow),
hint_bg: Box::new(color::Cyan),
text_fg: colors::BLACK,
text_bg: colors::WHITE,
focused_fg: colors::RED,
focused_bg: colors::BLUE,
span_fg: colors::GREEN,
span_bg: colors::MAGENTA,
hint_fg: colors::YELLOW,
hint_bg: colors::CYAN,
};
let mut writer = vec![];
@ -706,8 +706,8 @@ path: /usr/local/bin/cargo";
format!(
"{bg}{fg}{g1}some text{g2}* e006b06 - (12 days ago) swapper: Make quotes{g3}path: /usr/local/bin/git{g6}path: /usr/local/bin/cargo{fg_reset}{bg_reset}",
g1 = goto1, g2 = goto2, g3 = goto3, g6 = goto6,
fg = color::Fg(colors.text_fg.as_ref()),
bg = color::Bg(colors.text_bg.as_ref()),
fg = color::Fg(colors.text_fg),
bg = color::Bg(colors.text_bg),
fg_reset = color::Fg(color::Reset),
bg_reset = color::Bg(color::Reset),
)
@ -722,14 +722,14 @@ path: /usr/local/bin/cargo";
let focused = true;
let position: (usize, usize) = (3, 1);
let colors = UiColors {
text_fg: Box::new(color::Black),
text_bg: Box::new(color::White),
focused_fg: Box::new(color::Red),
focused_bg: Box::new(color::Blue),
span_fg: Box::new(color::Green),
span_bg: Box::new(color::Magenta),
hint_fg: Box::new(color::Yellow),
hint_bg: Box::new(color::Cyan),
text_fg: colors::BLACK,
text_bg: colors::WHITE,
focused_fg: colors::RED,
focused_bg: colors::BLUE,
span_fg: colors::GREEN,
span_bg: colors::MAGENTA,
hint_fg: colors::YELLOW,
hint_bg: colors::CYAN,
};
ViewController::render_span_text(&mut writer, text, focused, position, &colors);
@ -739,8 +739,8 @@ path: /usr/local/bin/cargo";
format!(
"{goto}{bg}{fg}{text}{fg_reset}{bg_reset}",
goto = cursor::Goto(4, 2),
fg = color::Fg(colors.focused_fg.as_ref()),
bg = color::Bg(colors.focused_bg.as_ref()),
fg = color::Fg(colors.focused_fg),
bg = color::Bg(colors.focused_bg),
fg_reset = color::Fg(color::Reset),
bg_reset = color::Bg(color::Reset),
text = &text,
@ -756,14 +756,14 @@ path: /usr/local/bin/cargo";
let focused = false;
let position: (usize, usize) = (3, 1);
let colors = UiColors {
text_fg: Box::new(color::Black),
text_bg: Box::new(color::White),
focused_fg: Box::new(color::Red),
focused_bg: Box::new(color::Blue),
span_fg: Box::new(color::Green),
span_bg: Box::new(color::Magenta),
hint_fg: Box::new(color::Yellow),
hint_bg: Box::new(color::Cyan),
text_fg: colors::BLACK,
text_bg: colors::WHITE,
focused_fg: colors::RED,
focused_bg: colors::BLUE,
span_fg: colors::GREEN,
span_bg: colors::MAGENTA,
hint_fg: colors::YELLOW,
hint_bg: colors::CYAN,
};
ViewController::render_span_text(&mut writer, text, focused, position, &colors);
@ -773,8 +773,8 @@ path: /usr/local/bin/cargo";
format!(
"{goto}{bg}{fg}{text}{fg_reset}{bg_reset}",
goto = cursor::Goto(4, 2),
fg = color::Fg(colors.span_fg.as_ref()),
bg = color::Bg(colors.span_bg.as_ref()),
fg = color::Fg(colors.span_fg),
bg = color::Bg(colors.span_bg),
fg_reset = color::Fg(color::Reset),
bg_reset = color::Bg(color::Reset),
text = &text,
@ -789,14 +789,14 @@ path: /usr/local/bin/cargo";
let hint_text = "eo";
let position: (usize, usize) = (3, 1);
let colors = UiColors {
text_fg: Box::new(color::Black),
text_bg: Box::new(color::White),
focused_fg: Box::new(color::Red),
focused_bg: Box::new(color::Blue),
span_fg: Box::new(color::Green),
span_bg: Box::new(color::Magenta),
hint_fg: Box::new(color::Yellow),
hint_bg: Box::new(color::Cyan),
text_fg: colors::BLACK,
text_bg: colors::WHITE,
focused_fg: colors::RED,
focused_bg: colors::BLUE,
span_fg: colors::GREEN,
span_bg: colors::MAGENTA,
hint_fg: colors::YELLOW,
hint_bg: colors::CYAN,
};
let offset = 0;
@ -815,8 +815,8 @@ path: /usr/local/bin/cargo";
format!(
"{goto}{bg}{fg}{text}{fg_reset}{bg_reset}",
goto = cursor::Goto(4, 2),
fg = color::Fg(colors.hint_fg.as_ref()),
bg = color::Bg(colors.hint_bg.as_ref()),
fg = color::Fg(colors.hint_fg),
bg = color::Bg(colors.hint_bg),
fg_reset = color::Fg(color::Reset),
bg_reset = color::Bg(color::Reset),
text = "eo",
@ -831,14 +831,14 @@ path: /usr/local/bin/cargo";
let hint_text = "eo";
let position: (usize, usize) = (3, 1);
let colors = UiColors {
text_fg: Box::new(color::Black),
text_bg: Box::new(color::White),
focused_fg: Box::new(color::Red),
focused_bg: Box::new(color::Blue),
span_fg: Box::new(color::Green),
span_bg: Box::new(color::Magenta),
hint_fg: Box::new(color::Yellow),
hint_bg: Box::new(color::Cyan),
text_fg: colors::BLACK,
text_bg: colors::WHITE,
focused_fg: colors::RED,
focused_bg: colors::BLUE,
span_fg: colors::GREEN,
span_bg: colors::MAGENTA,
hint_fg: colors::YELLOW,
hint_bg: colors::CYAN,
};
let offset = 0;
@ -857,8 +857,8 @@ path: /usr/local/bin/cargo";
format!(
"{goto}{bg}{fg}{sty}{text}{sty_reset}{fg_reset}{bg_reset}",
goto = cursor::Goto(4, 2),
fg = color::Fg(colors.hint_fg.as_ref()),
bg = color::Bg(colors.hint_bg.as_ref()),
fg = color::Fg(colors.hint_fg),
bg = color::Bg(colors.hint_bg),
fg_reset = color::Fg(color::Reset),
bg_reset = color::Bg(color::Reset),
sty = style::Underline,
@ -875,14 +875,14 @@ path: /usr/local/bin/cargo";
let hint_text = "eo";
let position: (usize, usize) = (3, 1);
let colors = UiColors {
text_fg: Box::new(color::Black),
text_bg: Box::new(color::White),
focused_fg: Box::new(color::Red),
focused_bg: Box::new(color::Blue),
span_fg: Box::new(color::Green),
span_bg: Box::new(color::Magenta),
hint_fg: Box::new(color::Yellow),
hint_bg: Box::new(color::Cyan),
text_fg: colors::BLACK,
text_bg: colors::WHITE,
focused_fg: colors::RED,
focused_bg: colors::BLUE,
span_fg: colors::GREEN,
span_bg: colors::MAGENTA,
hint_fg: colors::YELLOW,
hint_bg: colors::CYAN,
};
let offset = 0;
@ -901,8 +901,8 @@ path: /usr/local/bin/cargo";
format!(
"{goto}{bg}{fg}{bra}{text}{bra_close}{fg_reset}{bg_reset}",
goto = cursor::Goto(4, 2),
fg = color::Fg(colors.hint_fg.as_ref()),
bg = color::Bg(colors.hint_bg.as_ref()),
fg = color::Fg(colors.hint_fg),
bg = color::Bg(colors.hint_bg),
fg_reset = color::Fg(color::Reset),
bg_reset = color::Bg(color::Reset),
bra = '{',
@ -937,16 +937,16 @@ Barcelona https://en.wikipedia.org/wiki/Barcelona - ";
unique_hint,
);
let term_width: u16 = 80;
let wrapped_lines = compute_wrapped_lines(&model.lines, term_width);
let wrapped_lines = compute_wrapped_lines(model.lines, term_width);
let rendering_colors = UiColors {
text_fg: Box::new(color::Black),
text_bg: Box::new(color::White),
focused_fg: Box::new(color::Red),
focused_bg: Box::new(color::Blue),
span_fg: Box::new(color::Green),
span_bg: Box::new(color::Magenta),
hint_fg: Box::new(color::Yellow),
hint_bg: Box::new(color::Cyan),
text_fg: colors::BLACK,
text_bg: colors::WHITE,
focused_fg: colors::RED,
focused_bg: colors::BLUE,
span_fg: colors::GREEN,
span_bg: colors::MAGENTA,
hint_fg: colors::YELLOW,
hint_bg: colors::CYAN,
};
let hint_alignment = HintAlignment::Leading;
@ -974,8 +974,8 @@ Barcelona https://en.wikipedia.org/wiki/Barcelona - ";
{goto3}Barcelona https://en.wikipedia.org/wiki/Barcelona -{fg_reset}{bg_reset}",
goto1 = goto1,
goto3 = goto3,
fg = color::Fg(rendering_colors.text_fg.as_ref()),
bg = color::Bg(rendering_colors.text_bg.as_ref()),
fg = color::Fg(rendering_colors.text_fg),
bg = color::Bg(rendering_colors.text_bg),
fg_reset = color::Fg(color::Reset),
bg_reset = color::Bg(color::Reset),
);
@ -1013,14 +1013,14 @@ Barcelona https://en.wikipedia.org/wiki/Barcelona - ";
let default_output_destination = OutputDestination::Tmux;
let rendering_colors = UiColors {
text_fg: Box::new(color::Black),
text_bg: Box::new(color::White),
focused_fg: Box::new(color::Red),
focused_bg: Box::new(color::Blue),
span_fg: Box::new(color::Green),
span_bg: Box::new(color::Magenta),
hint_fg: Box::new(color::Yellow),
hint_bg: Box::new(color::Cyan),
text_fg: colors::BLACK,
text_bg: colors::WHITE,
focused_fg: colors::RED,
focused_bg: colors::BLUE,
span_fg: colors::GREEN,
span_bg: colors::MAGENTA,
hint_fg: colors::YELLOW,
hint_bg: colors::CYAN,
};
let hint_alignment = HintAlignment::Leading;
let hint_style = None;
@ -1046,8 +1046,8 @@ Barcelona https://en.wikipedia.org/wiki/Barcelona - ";
{goto3}Barcelona https://en.wikipedia.org/wiki/Barcelona -{fg_reset}{bg_reset}",
goto1 = goto1,
goto3 = goto3,
fg = color::Fg(rendering_colors.text_fg.as_ref()),
bg = color::Bg(rendering_colors.text_bg.as_ref()),
fg = color::Fg(rendering_colors.text_fg),
bg = color::Bg(rendering_colors.text_bg),
fg_reset = color::Fg(color::Reset),
bg_reset = color::Bg(color::Reset)
)
@ -1058,8 +1058,8 @@ Barcelona https://en.wikipedia.org/wiki/Barcelona - ";
format!(
"{goto7_1}{span_bg}{span_fg}127.0.0.1{fg_reset}{bg_reset}",
goto7_1 = goto7_1,
span_fg = color::Fg(rendering_colors.span_fg.as_ref()),
span_bg = color::Bg(rendering_colors.span_bg.as_ref()),
span_fg = color::Fg(rendering_colors.span_fg),
span_bg = color::Bg(rendering_colors.span_bg),
fg_reset = color::Fg(color::Reset),
bg_reset = color::Bg(color::Reset)
)
@ -1071,8 +1071,8 @@ Barcelona https://en.wikipedia.org/wiki/Barcelona - ";
format!(
"{goto7_1}{hint_bg}{hint_fg}b{fg_reset}{bg_reset}",
goto7_1 = goto7_1,
hint_fg = color::Fg(rendering_colors.hint_fg.as_ref()),
hint_bg = color::Bg(rendering_colors.hint_bg.as_ref()),
hint_fg = color::Fg(rendering_colors.hint_fg),
hint_bg = color::Bg(rendering_colors.hint_bg),
fg_reset = color::Fg(color::Reset),
bg_reset = color::Bg(color::Reset)
)
@ -1083,8 +1083,8 @@ Barcelona https://en.wikipedia.org/wiki/Barcelona - ";
format!(
"{goto11_3}{focus_bg}{focus_fg}https://en.wikipedia.org/wiki/Barcelona{fg_reset}{bg_reset}",
goto11_3 = goto11_3,
focus_fg = color::Fg(rendering_colors.focused_fg.as_ref()),
focus_bg = color::Bg(rendering_colors.focused_bg.as_ref()),
focus_fg = color::Fg(rendering_colors.focused_fg),
focus_bg = color::Bg(rendering_colors.focused_bg),
fg_reset = color::Fg(color::Reset),
bg_reset = color::Bg(color::Reset)
)