chore: fix typo

pull/388/head
sigoden 2 months ago
parent b91d1c4a93
commit 2654542601

@ -197,7 +197,7 @@ fn extract_text(data: &Value) -> Result<&str> {
.as_str()
.or_else(|| data["candidates"][0]["finishReason"].as_str())
{
bail!("Blocked by safety settingsconsider ajusting `block_threshold` in the client configuraion")
bail!("Blocked by safety settingsconsider adjusting `block_threshold` in the client configuration")
} else {
bail!("Invalid response data: {data}")
}

@ -229,11 +229,11 @@ pub enum LineType {
CodeEnd,
}
fn as_terminal_escaped(ranges: &[(Style, &str)], trucolor: bool) -> String {
fn as_terminal_escaped(ranges: &[(Style, &str)], truecolor: bool) -> String {
let mut output = String::new();
for (style, text) in ranges {
let fg = blend_fg_color(style.foreground, style.background);
let mut text = text.with(convert_color(fg, trucolor));
let mut text = text.with(convert_color(fg, truecolor));
if style.font_style.contains(FontStyle::BOLD) {
text = text.bold();
}
@ -245,8 +245,8 @@ fn as_terminal_escaped(ranges: &[(Style, &str)], trucolor: bool) -> String {
output
}
fn convert_color(c: SyntectColor, trucolor: bool) -> Color {
if trucolor {
fn convert_color(c: SyntectColor, truecolor: bool) -> Color {
if truecolor {
Color::Rgb {
r: c.r,
g: c.g,
@ -291,7 +291,7 @@ fn detect_code_block(line: &str) -> Option<String> {
Some(lang)
}
fn get_code_color(theme: &Theme, trucolor: bool) -> Color {
fn get_code_color(theme: &Theme, truecolor: bool) -> Color {
let scope = theme.scopes.iter().find(|v| {
v.scope
.selectors
@ -300,7 +300,7 @@ fn get_code_color(theme: &Theme, trucolor: bool) -> Color {
});
scope
.and_then(|v| v.style.foreground)
.map_or_else(|| Color::Yellow, |c| convert_color(c, trucolor))
.map_or_else(|| Color::Yellow, |c| convert_color(c, truecolor))
}
#[cfg(test)]

Loading…
Cancel
Save