-
-
Notifications
You must be signed in to change notification settings - Fork 709
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add possibility to set up highlighten prefix and postfix for snippet #1422
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comments
e550a98
to
84e0c75
Compare
Thank you for review! Did these fixes and reduced test. |
@fulmicoton hi, what the status with this feature? |
@PSeitz hey, can you help with review, please? |
Codecov Report
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. @@ Coverage Diff @@
## main #1422 +/- ##
==========================================
+ Coverage 94.47% 94.48% +0.01%
==========================================
Files 319 319
Lines 59404 59460 +56
==========================================
+ Hits 56119 56178 +59
+ Misses 3285 3282 -3
|
src/snippet/mod.rs
Outdated
@@ -101,6 +115,12 @@ impl Snippet { | |||
pub fn highlighted(&self) -> &[Range<usize>] { | |||
&self.highlighted | |||
} | |||
|
|||
/// Sets highlighted prefix and postfix. | |||
pub fn set_highlighted_elements(&mut self, prefix: &str, postfix: &str) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pub fn set_highlighted_elements(&mut self, prefix: &str, postfix: &str) { | |
pub fn set_snippet_prefix_postfix(&mut self, prefix: &str, postfix: &str) { |
src/snippet/mod.rs
Outdated
@@ -55,17 +58,28 @@ impl FragmentCandidate { | |||
pub struct Snippet { | |||
fragment: String, | |||
highlighted: Vec<Range<usize>>, | |||
highlighting_prefix: String, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
highlighting_prefix: String, | |
snippet_prefix: String, |
src/snippet/mod.rs
Outdated
@@ -55,17 +58,28 @@ impl FragmentCandidate { | |||
pub struct Snippet { | |||
fragment: String, | |||
highlighted: Vec<Range<usize>>, | |||
highlighting_prefix: String, | |||
highlighting_postfix: String, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
highlighting_postfix: String, | |
snippet_postfix: String, |
@lavrd Thanks! |
This PR adds a possibility to change highlight prefix and postfix for snippets.