🏡 index : ~doyle/rgit.git

author Jordan Doyle <jordan@doyle.la> 2024-05-21 11:46:19.0 +02:00:00
committer Jordan Doyle <jordan@doyle.la> 2024-05-21 11:46:19.0 +02:00:00
commit
27cfc0ac5f70f7b706fb91fbe7f9f13f3f5edbf7 [patch]
tree
f40ac749b5e8c63e57d4c9b077adfb5c4575be0a
parent
74e31cb660c6126a1f913c3c28c727cf4b3feb40
download
27cfc0ac5f70f7b706fb91fbe7f9f13f3f5edbf7.tar.gz

Fix newlines not being inserted when code tags aren't used for line breaks



Diff

 src/git.rs | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/git.rs b/src/git.rs
index 6055553..6eec6cf 100644
--- a/src/git.rs
+++ a/src/git.rs
@@ -710,7 +710,8 @@

        if line.len() > 2048 {
            // avoid highlighting overly complex lines
            write!(out, "{}", Escape(line.trim_end()))?;
            let line = if code_tag { line.trim_end() } else { line };
            write!(out, "{}", Escape(line))?;
        } else {
            let mut cur_index = 0;
            let ops = parse_state.parse_line(line, syntax_set)?;
@@ -754,7 +755,7 @@
                })?;
            }

            let line = line.trim_end();
            let line = if code_tag { line.trim_end() } else { line };
            if line.len() > cur_index {
                write!(out, "{}", Escape(&line[cur_index..]))?;
            }