Skip to content

Commit d607bdc

Browse files
authored
fix: ignore newlines when printing with ruler file (gokcehan#2319)
* fix: ignore newlines when printing with ruler file * Update `CHANGELOG.md`
1 parent 9dac520 commit d607bdc

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
1818
### Fixed
1919

2020
- A bug where sixel images fail to display when scrolling back and forth is now fixed (#2301).
21+
- Newline characters are now ignored when drawing the ruler with the `ruler` file configured (#2319).
2122

2223
## [r40](https://github.com/gokcehan/lf/releases/tag/r40)
2324

ruler.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,7 @@ func renderRuler(ruler *template.Template, data rulerData, width int) (string, s
7676
return "", "", err
7777
}
7878

79-
s := strings.TrimSuffix(b.String(), "\n")
80-
s = strings.ReplaceAll(s, "\n", "\033[0;7m\\n\033[0m")
79+
s := strings.ReplaceAll(b.String(), "\n", "")
8180
sections := strings.Split(s, "\x1f")
8281

8382
if len(sections) == 1 {

0 commit comments

Comments
 (0)