diff --git a/README.md b/README.md index d67dcbb..571dfa8 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ v1.x has a different architecture and better performance than v0.x, and v1.x can - 🔢 [WIP] Column number ## Prerequirements -- Neovim 9.0+ +- Neovim 0.9.0+ ## Install We recommend using [Lazy.nvim](https://github.com/folke/lazy.nvim) to install CodeSnap.nvim, but you can still use another plugin manager you prefer. diff --git a/doc/plugin-name.txt b/doc/plugin-name.txt index 442e7f3..ed33c2f 100644 --- a/doc/plugin-name.txt +++ b/doc/plugin-name.txt @@ -1,4 +1,4 @@ **codesnap.nvim** 📸 Snapshot plugin that can make pretty code snapshots with real-time previews for Neovim Author: Mist -version: 1.1.11 +version: 1.1.12 diff --git a/generator/src/highlight.rs b/generator/src/highlight.rs index 88c3e00..3d2096f 100644 --- a/generator/src/highlight.rs +++ b/generator/src/highlight.rs @@ -1,3 +1,5 @@ +use std::collections::HashMap; + use cosmic_text::{Attrs, Family, Style, Weight}; use syntect::{ easy::HighlightLines, @@ -8,11 +10,14 @@ use syntect::{ use crate::components::interface::render_error::RenderError; +type SourceMap = HashMap<&'static str, &'static str>; + pub struct Highlight { content: String, code_file_path: String, extension: Option, font_family: String, + highlighting_language_source_map: SourceMap, } pub type HighlightResult<'a> = Vec<(&'a str, Attrs<'a>)>; @@ -29,6 +34,7 @@ impl Highlight { code_file_path, extension, font_family, + highlighting_language_source_map: HashMap::from([("PHP", "