mirror of
https://github.com/charmbracelet/glow
synced 2024-11-10 06:04:18 +00:00
Add right padding to markdown rendering
This commit is contained in:
parent
f3021822f3
commit
1971c8abd8
1 changed files with 9 additions and 7 deletions
16
ui/pager.go
16
ui/pager.go
|
@ -17,12 +17,13 @@ import (
|
|||
)
|
||||
|
||||
const (
|
||||
statusBarHeight = 1
|
||||
gray = "#333333"
|
||||
yellowGreen = "#ECFD65"
|
||||
fuschia = "#EE6FF8"
|
||||
noteHeadingText = " Set Memo "
|
||||
notePromptText = " > "
|
||||
statusBarHeight = 1
|
||||
viewportHorizontalPadding = 2
|
||||
gray = "#333333"
|
||||
yellowGreen = "#ECFD65"
|
||||
fuschia = "#EE6FF8"
|
||||
noteHeadingText = " Set Memo "
|
||||
notePromptText = " > "
|
||||
)
|
||||
|
||||
var (
|
||||
|
@ -281,9 +282,10 @@ func glamourRender(m pagerModel, markdown string) (string, error) {
|
|||
gs = glamour.WithStylePath(m.glamourStyle)
|
||||
}
|
||||
|
||||
width := max(0, min(120, m.viewport.Width-viewportHorizontalPadding))
|
||||
r, err := glamour.NewTermRenderer(
|
||||
gs,
|
||||
glamour.WithWordWrap(min(120, m.viewport.Width)),
|
||||
glamour.WithWordWrap(width),
|
||||
)
|
||||
if err != nil {
|
||||
return "", err
|
||||
|
|
Loading…
Reference in a new issue