Do not add a trailing newline when wrapping

This commit is contained in:
Kovid Goyal
2023-03-27 07:53:55 +05:30
parent e42b4fd9a6
commit 924cd4cadd
4 changed files with 8 additions and 7 deletions
+1 -5
View File
@@ -235,11 +235,7 @@ func lines_for_context_chunk(data *DiffData, hunk_num int, chunk *Chunk, chunk_n
}
func splitlines(text string, width int) []string {
lines := style.WrapTextAsLines(text, "", width)
if len(lines) > 1 && lines[len(lines)-1] == "" {
lines = lines[:len(lines)-1]
}
return lines
return style.WrapTextAsLines(text, "", width)
}
func render_half_line(line_number int, line, ltype string, margin_size, available_cols int, center Center, ans []string) []string {