Merge pull request #1233 from ahlinc/fix/highlighting-theme-loading

fix(cli): fix theme key loading from config.json, closes #1232
This commit is contained in:
Max Brunsfeld 2021-07-05 08:48:40 -07:00 committed by GitHub
commit 0926fad1e2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View file

@ -14,6 +14,7 @@ use std::{env, fs};
/// This type holds the generic JSON content of the configuration file. Individual tree-sitter
/// components will use the [`get`][] method to parse that JSON to extract configuration fields
/// that are specific to that component.
#[derive(Debug)]
pub struct Config {
pub location: PathBuf,
pub config: Value,

View file

@ -418,11 +418,10 @@ fn run() -> Result<()> {
if let Some(highlight_config) = language_config.highlight_config(language)? {
let source = fs::read(path)?;
let theme_config = config.get()?;
if html_mode {
highlight::html(
&loader,
&theme_config,
&theme_config.theme,
&source,
highlight_config,
quiet,
@ -431,7 +430,7 @@ fn run() -> Result<()> {
} else {
highlight::ansi(
&loader,
&theme_config,
&theme_config.theme,
&source,
highlight_config,
time,