Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module notmutt
go 1.26.6

require (
charm.land/lipgloss/v2 v2.0.5
charm.land/lipgloss/v2 v2.1.1
github.com/BurntSushi/toml v1.6.0
github.com/andybalholm/cascadia v1.3.4
github.com/emersion/go-message v0.18.2
Expand Down Expand Up @@ -35,8 +35,8 @@ require (
git.sr.ht/~jackmordaunt/go-toast v1.1.2 // indirect
github.com/alecthomas/chroma/v2 v2.21.1 // indirect
github.com/charmbracelet/colorprofile v0.4.3 // indirect
github.com/charmbracelet/ultraviolet v0.0.0-20251205161215-1948445e3318 // indirect
github.com/charmbracelet/x/ansi v0.11.7 // indirect
github.com/charmbracelet/ultraviolet v0.0.0-20260811164956-006e29f97886 // indirect
github.com/charmbracelet/x/ansi v0.11.8 // indirect
github.com/charmbracelet/x/term v0.2.2 // indirect
github.com/charmbracelet/x/termios v0.1.1 // indirect
github.com/charmbracelet/x/windows v0.2.2 // indirect
Expand Down
27 changes: 12 additions & 15 deletions src/go.sum
Original file line number Diff line number Diff line change
@@ -1,21 +1,25 @@
charm.land/lipgloss/v2 v2.0.5 h1:kbNxgeeUOYv5J0YdpxFjfvf3dFvqH8Aci4zB6xqFtrY=
charm.land/lipgloss/v2 v2.0.5/go.mod h1:9oqhxt4yxIMe6q5A4kHr44DremZk7J9UNh74GlWa5nc=
charm.land/lipgloss/v2 v2.1.1 h1:F+vKWis9Kz3MFRsbICSDFtT1ZwVL+8f+36Dtg+OpKwc=
charm.land/lipgloss/v2 v2.1.1/go.mod h1:k79y/56yThpkJvbwyrcHr8MyZF42e84Q5fW9Ibu6LFc=
git.sr.ht/~jackmordaunt/go-toast v1.1.2 h1:/yrfI55LRt1M7H1vkaw+NaH1+L1CDxrqDltwm5euVuE=
git.sr.ht/~jackmordaunt/go-toast v1.1.2/go.mod h1:jA4OqHKTQ4AFBdwrSnwnskUIIS3HYzlJSgdzCKqfavo=
github.com/BurntSushi/toml v1.6.0 h1:dRaEfpa2VI55EwlIW72hMRHdWouJeRF7TPYhI+AUQjk=
github.com/BurntSushi/toml v1.6.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
github.com/alecthomas/assert/v2 v2.11.0 h1:2Q9r3ki8+JYXvGsDyBXwH3LcJ+WK5D0gc5E8vS6K3D0=
github.com/alecthomas/assert/v2 v2.11.0/go.mod h1:Bze95FyfUr7x34QZrjL+XP+0qgp/zg8yS+TtBj1WA3k=
github.com/alecthomas/chroma/v2 v2.2.0/go.mod h1:vf4zrexSH54oEjJ7EdB65tGNHmH3pGZmVkgTP5RHvAs=
github.com/alecthomas/chroma/v2 v2.21.1 h1:FaSDrp6N+3pphkNKU6HPCiYLgm8dbe5UXIXcoBhZSWA=
github.com/alecthomas/chroma/v2 v2.21.1/go.mod h1:NqVhfBR0lte5Ouh3DcthuUCTUpDC9cxBOfyMbMQPs3o=
github.com/alecthomas/repr v0.0.0-20220113201626-b1b626ac65ae/go.mod h1:2kn6fqh/zIyPLmm3ugklbEi5hg5wS435eygvNfaDQL8=
github.com/alecthomas/repr v0.5.2 h1:SU73FTI9D1P5UNtvseffFSGmdNci/O6RsqzeXJtP0Qs=
github.com/alecthomas/repr v0.5.2/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4=
github.com/andybalholm/cascadia v1.3.4 h1:vM2lgh0Vru9Vwyfm4cQqWP2HHMW0u0+2PAW7Q38Qufg=
github.com/andybalholm/cascadia v1.3.4/go.mod h1:BLRmbRjpEtNKieZOCCvYj4RqN+KRA41GBe/5O+G93kM=
github.com/charmbracelet/colorprofile v0.4.3 h1:QPa1IWkYI+AOB+fE+mg/5/4HRMZcaXex9t5KX76i20Q=
github.com/charmbracelet/colorprofile v0.4.3/go.mod h1:/zT4BhpD5aGFpqQQqw7a+VtHCzu+zrQtt1zhMt9mR4Q=
github.com/charmbracelet/ultraviolet v0.0.0-20251205161215-1948445e3318 h1:OqDqxQZliC7C8adA7KjelW3OjtAxREfeHkNcd66wpeI=
github.com/charmbracelet/ultraviolet v0.0.0-20251205161215-1948445e3318/go.mod h1:Y6kE2GzHfkyQQVCSL9r2hwokSrIlHGzZG+71+wDYSZI=
github.com/charmbracelet/x/ansi v0.11.7 h1:kzv1kJvjg2S3r9KHo8hDdHFQLEqn4RBCb39dAYC84jI=
github.com/charmbracelet/x/ansi v0.11.7/go.mod h1:9qGpnAVYz+8ACONkZBUWPtL7lulP9No6p1epAihUZwQ=
github.com/charmbracelet/ultraviolet v0.0.0-20260811164956-006e29f97886 h1:rdnVWKgJpTVXKuKuJyxDJ+NFJdUaUqGvyGy61OcvlbA=
github.com/charmbracelet/ultraviolet v0.0.0-20260811164956-006e29f97886/go.mod h1:nAw0d9PhFp1qdzi2xhQU5YOu5sVpDIHWlaW2Uz/bCro=
github.com/charmbracelet/x/ansi v0.11.8 h1:JMFwp0CgDC2+jcOB162HH5k7I3FVbgFSMMYg7dSPBQQ=
github.com/charmbracelet/x/ansi v0.11.8/go.mod h1:ZNN+3mXny/516oTQPLMPIBeSINvNJJQ8uQXDgbeJxY0=
github.com/charmbracelet/x/term v0.2.2 h1:xVRT/S2ZcKdhhOuSP4t5cLi5o+JxklsoEObBSgfgZRk=
github.com/charmbracelet/x/term v0.2.2/go.mod h1:kF8CY5RddLWrsgVwpw4kAa6TESp6EB5y3uxGLeCqzAI=
github.com/charmbracelet/x/termios v0.1.1 h1:o3Q2bT8eqzGnGPOYheoYS8eEleT5ZVNYNy8JawjaNZY=
Expand All @@ -31,18 +35,12 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/dlclark/regexp2 v1.4.0/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc=
github.com/dlclark/regexp2 v1.7.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8=
github.com/dlclark/regexp2 v1.11.0 h1:G/nrcoOa7ZXlpoa/91N3X7mM3r8eIlMBBJZvsz/mxKI=
github.com/dlclark/regexp2 v1.11.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8=
github.com/dlclark/regexp2 v1.11.5 h1:Q/sSnsKerHeCkc/jSTNq1oCm7KiVgUMZRDUoRu0JQZQ=
github.com/dlclark/regexp2 v1.11.5/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8=
github.com/emersion/go-message v0.18.2 h1:rl55SQdjd9oJcIoQNhubD2Acs1E6IzlZISRTK7x/Lpg=
github.com/emersion/go-message v0.18.2/go.mod h1:XpJyL70LwRvq2a8rVbHXikPgKj8+aI0kGdHlg16ibYA=
github.com/esiqveland/notify v0.13.3 h1:QCMw6o1n+6rl+oLUfg8P1IIDSFsDEb2WlXvVvIJbI/o=
github.com/esiqveland/notify v0.13.3/go.mod h1:hesw/IRYTO0x99u1JPweAl4+5mwXJibQVUcP0Iu5ORE=
github.com/fishman/go.notmuch v0.40.4 h1:vR5hSOKsvw7+UxksxMb7BEZNcUtuHu46WePZet3/cR8=
github.com/fishman/go.notmuch v0.40.4/go.mod h1:AKg575C53q19SkRGHdc/zKhimx3i0UX7q7XnFLtlAvI=
github.com/fishman/go.notmuch v0.40.5 h1:CqQjoMoirJlvo1asHeGL34mMB3zM1up7GQvb63ulAfo=
github.com/fishman/go.notmuch v0.40.5/go.mod h1:AKg575C53q19SkRGHdc/zKhimx3i0UX7q7XnFLtlAvI=
github.com/fishman/go.notmuch v0.40.6 h1:rSjT5M8udYtTccjZf2pNtnUoWj7kqJaRMhfSEKPfcv0=
github.com/fishman/go.notmuch v0.40.6/go.mod h1:AKg575C53q19SkRGHdc/zKhimx3i0UX7q7XnFLtlAvI=
github.com/fishman/zaman v0.1.2 h1:WjeSaOO6BJzvy2RA9Rj1tO6V0eSB13cWg5ojDCanqzc=
Expand All @@ -51,8 +49,6 @@ github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHk
github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=
github.com/gdamore/encoding v1.0.1 h1:YzKZckdBL6jVt2Gc+5p82qhrGiqMdG/eNs6Wy0u3Uhw=
github.com/gdamore/encoding v1.0.1/go.mod h1:0Z0cMFinngz9kS1QfMjCP8TY7em3bZYeeklsSDPivEo=
github.com/gdamore/tcell/v3 v3.4.2 h1:gGW+6z2Bz5Wl2mNwFlm9+eRmg2JQrWcKjSkL1LRfpNU=
github.com/gdamore/tcell/v3 v3.4.2/go.mod h1:Oe5U3S3jm3NzypswDNUhe+LUnF5CoFq2b4sepD++QHo=
github.com/gdamore/tcell/v3 v3.5.0 h1:SCp9czLv2K2aPORgD6+4fjV0xNAzKIkiezCkp6bHLe4=
github.com/gdamore/tcell/v3 v3.5.0/go.mod h1:Oe5U3S3jm3NzypswDNUhe+LUnF5CoFq2b4sepD++QHo=
github.com/gen2brain/beeep v0.11.2 h1:+KfiKQBbQCuhfJFPANZuJ+oxsSKAYNe88hIpJuyKWDA=
Expand All @@ -67,6 +63,8 @@ github.com/google/jsonschema-go v0.4.2 h1:tmrUohrwoLZZS/P3x7ex0WAVknEkBZM46iALbc
github.com/google/jsonschema-go v0.4.2/go.mod h1:r5quNTdLOYEz95Ru18zA0ydNbBuYoo9tgaYcxEYhJVE=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM=
github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg=
github.com/jackmordaunt/icns/v3 v3.0.1 h1:xxot6aNuGrU+lNgxz5I5H0qSeCjNKp8uTXB1j8D4S3o=
github.com/jackmordaunt/icns/v3 v3.0.1/go.mod h1:5sHL59nqTd2ynTnowxB/MDQFhKNqkK8X687uKNygaSQ=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
Expand Down Expand Up @@ -128,7 +126,6 @@ github.com/yuin/goldmark v1.8.2 h1:kEGpgqJXdgbkhcOgBxkC0X0PmoPG1ZyoZ117rDVp4zE=
github.com/yuin/goldmark v1.8.2/go.mod h1:ip/1k0VRfGynBgxOz0yCqHrbZXhcjxyuS66Brc7iBKg=
github.com/yuin/goldmark-highlighting/v2 v2.0.0-20220924101305-151362477c87 h1:Py16JEzkSdKAtEFJjiaYLYBOWGXc1r/xHj/Q/5lA37k=
github.com/yuin/goldmark-highlighting/v2 v2.0.0-20220924101305-151362477c87/go.mod h1:ovIvrum6DQJA4QsJSovrkC4saKHQVs7TvcaeO8AIl5I=
github.com/yuin/goldmark-highlighting/v2 v2.0.0-20230729083705-37449abec8cc/go.mod h1:ovIvrum6DQJA4QsJSovrkC4saKHQVs7TvcaeO8AIl5I=
github.com/yuin/gopher-lua v1.1.2 h1:yF/FjE3hD65tBbt0VXLE13HWS9h34fdzJmrWRXwobGA=
github.com/yuin/gopher-lua v1.1.2/go.mod h1:7aRmXIWl37SqRf0koeyylBEzJ+aPt8A+mmkQ4f1ntR8=
go.etcd.io/bbolt v1.3.11 h1:yGEzV1wPz2yVCLsD8ZAiGHhHVlczyC9d1rP43/VCRJ0=
Expand Down
6 changes: 5 additions & 1 deletion src/vendor/charm.land/lipgloss/v2/borders.go
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,11 @@ func renderHorizontalEdge(left, middle, right string, width int) string {
for i := 0; i < width-leftWidth-rightWidth; {
r := runes[j]
out.WriteRune(r)
i += ansi.StringWidth(string(r))
runeWidth := ansi.StringWidth(string(r))
if runeWidth < 1 {
runeWidth = 1
}
i += runeWidth
j++
if j >= len(runes) {
j = 0
Expand Down
5 changes: 3 additions & 2 deletions src/vendor/charm.land/lipgloss/v2/canvas.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ func (c *Canvas) Draw(scr uv.Screen, area uv.Rectangle) {
c.scr.Draw(scr, area)
}

// Render renders the canvas into a styled string.
// Render renders the canvas into a styled string. Any trailing spaces are
// trimmed.
func (c *Canvas) Render() string {
return c.scr.Render()
return uv.TrimSpace(c.scr.Render())
}
13 changes: 4 additions & 9 deletions src/vendor/charm.land/lipgloss/v2/color.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,12 +144,7 @@ type RGBColor struct {
// RGBA returns the RGBA value of this color. This satisfies the Go Color
// interface.
func (c RGBColor) RGBA() (r, g, b, a uint32) {
const shift = 8
r |= uint32(c.R) << shift
g |= uint32(c.G) << shift
b |= uint32(c.B) << shift
a = 0xFFFF
return
return color.RGBA{R: c.R, G: c.G, B: c.B, A: 255}.RGBA()
}

// ANSIColor is a color specified by an ANSI256 color value.
Expand Down Expand Up @@ -211,8 +206,8 @@ func LightDark(isDark bool) LightDarkFunc {
}
}

// isDarkColor returns whether the given color is dark (based on the luminance
// portion of the color as interpreted as HSL).
// isDarkColor returns whether the given color is dark, based on its CIELAB
// lightness.
//
// Example usage:
//
Expand All @@ -228,7 +223,7 @@ func isDarkColor(c color.Color) bool {
return true
}

_, _, l := col.Hsl()
l, _, _ := col.Lab()
return l < 0.5 //nolint:mnd
}

Expand Down
2 changes: 1 addition & 1 deletion src/vendor/charm.land/lipgloss/v2/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ func (s Style) getAsBool(k propKey, defaultVal bool) bool {
if !s.isSet(k) {
return defaultVal
}
return s.attrs&int(k) != 0
return s.attrs&int64(k) != 0
}

func (s Style) getAsColors(k propKey) (colors []color.Color) {
Expand Down
12 changes: 6 additions & 6 deletions src/vendor/charm.land/lipgloss/v2/set.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,16 +89,16 @@ func (s *Style) set(key propKey, value any) {
default:
if v, ok := value.(bool); ok { //nolint:nestif
if v {
s.attrs |= int(key)
s.attrs |= int64(key)
} else {
s.attrs &^= int(key)
s.attrs &^= int64(key)
}
} else if attrs, ok := value.(int); ok {
} else if attrs, ok := value.(int64); ok {
// bool attrs
if attrs&int(key) != 0 {
s.attrs |= int(key)
if attrs&int64(key) != 0 {
s.attrs |= int64(key)
} else {
s.attrs &^= int(key)
s.attrs &^= int64(key)
}
}
}
Expand Down
54 changes: 43 additions & 11 deletions src/vendor/charm.land/lipgloss/v2/style.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ type Style struct {
link, linkParams string

// we store bool props values here
attrs int
attrs int64

// props that have values
fgColor color.Color
Expand Down Expand Up @@ -399,9 +399,11 @@ func (s Style) Render(strs ...string) string {
// carriage returns can cause strange behaviour when rendering.
str = strings.ReplaceAll(str, "\r\n", "\n")

// Strip newlines in single line mode
// Strip newlines in single line mode. Replace with a space so that
// words on separate lines stay separated when collapsed onto one
// line (e.g. "hello\nworld" -> "hello world", not "helloworld").
if inline {
str = strings.ReplaceAll(str, "\n", "")
str = strings.ReplaceAll(str, "\n", " ")
}

// Include borders in block size.
Expand All @@ -426,13 +428,28 @@ func (s Style) Render(strs ...string) string {
b.WriteRune('\n')
}
if useSpaceStyler {
// Look for spaces and apply a different styler
for _, r := range line {
if unicode.IsSpace(r) {
b.WriteString(teSpace.Styled(string(r)))
continue
// Look for spaces and apply a different styler, while passing
// through any ANSI escape sequences already present in the line
// so they are not mangled (e.g. when rendering an
// already-styled string).
// See https://github.com/charmbracelet/lipgloss/issues/233.
var state byte
for len(line) > 0 {
seq, width, n, newState := ansi.DecodeSequence(line, state, nil)
if n == 0 {
break
}
b.WriteString(te.Styled(string(r)))
switch {
case width == 0:
// Control or escape sequence: emit verbatim, unstyled.
b.WriteString(seq)
case isSpaceSequence(seq):
b.WriteString(teSpace.Styled(seq))
default:
b.WriteString(te.Styled(seq))
}
line = line[n:]
state = newState
}
} else {
b.WriteString(te.Styled(line))
Expand Down Expand Up @@ -525,6 +542,17 @@ func (s Style) Render(strs ...string) string {
return str
}

// isSpaceSequence reports whether the given grapheme consists solely of
// whitespace runes.
func isSpaceSequence(s string) bool {
for _, r := range s {
if !unicode.IsSpace(r) {
return false
}
}
return s != ""
}

func (s Style) maybeConvertTabs(str string) string {
tw := tabWidthDefault
if s.isSet(tabWidthKey) {
Expand Down Expand Up @@ -568,11 +596,15 @@ func (s Style) applyMargins(str string, inline bool) string {
_, width := getLines(str)
spaces := strings.Repeat(" ", width)

// Style each margin line on its own so the reset lands before the
// newline, not at the start of the next line (see #115).
if topMargin > 0 {
str = style.Styled(strings.Repeat(spaces+"\n", topMargin)) + str
line := style.Styled(spaces)
str = strings.Repeat(line+"\n", topMargin) + str
}
if bottomMargin > 0 {
str += style.Styled(strings.Repeat("\n"+spaces, bottomMargin))
line := style.Styled(spaces)
str += strings.Repeat("\n"+line, bottomMargin)
}
}

Expand Down
4 changes: 3 additions & 1 deletion src/vendor/charm.land/lipgloss/v2/unset.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ func (s Style) UnsetItalic() Style {

// UnsetUnderline removes the underline style rule, if set.
func (s Style) UnsetUnderline() Style {
return s.Underline(false)
s.unset(underlineKey)
s.ul = UnderlineNone
return s
}

// UnsetStrikethrough removes the strikethrough style rule, if set.
Expand Down
47 changes: 31 additions & 16 deletions src/vendor/charm.land/lipgloss/v2/wrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,12 @@ import (
func Wrap(s string, width int, breakpoints string) string {
var buf bytes.Buffer
s = ansi.Wrap(s, width, breakpoints)
// The writer only inserts resets around newlines, so the output is
// the same length as the input plus a little. Size it once.
buf.Grow(len(s) + len(s)/8)
w := NewWrapWriter(&buf)
defer w.Close() //nolint:errcheck
_, _ = io.WriteString(w, s)
_ = w.Close()
return buf.String()
}

Expand Down Expand Up @@ -69,27 +72,39 @@ func (w *WrapWriter) Write(p []byte) (int, error) {
// nested writer chains; treat it as a no-op rather than panicking.
return len(p), nil
}
// Bytes are forwarded in runs rather than one at a time: only a
// newline needs anything written around it, so everything between
// newlines is a single downstream Write instead of one per byte.
start := 0
for i := range p {
b := p[i]
w.p.Advance(b)
if b == '\n' {
if !w.style.IsZero() {
_, _ = w.w.Write([]byte(ansi.ResetStyle))
}
if !w.link.IsZero() {
_, _ = w.w.Write([]byte(ansi.ResetHyperlink()))
}
if b != '\n' {
continue
}

_, _ = w.w.Write([]byte{b})
if b == '\n' {
if !w.link.IsZero() {
_, _ = w.w.Write([]byte(ansi.SetHyperlink(w.link.URL, w.link.Params)))
}
if !w.style.IsZero() {
_, _ = w.w.Write([]byte(w.style.String()))
}
if i > start {
_, _ = w.w.Write(p[start:i])
}
if !w.style.IsZero() {
_, _ = w.w.Write([]byte(ansi.ResetStyle))
}
if !w.link.IsZero() {
_, _ = w.w.Write([]byte(ansi.ResetHyperlink()))
}

_, _ = w.w.Write(p[i : i+1])
start = i + 1

if !w.link.IsZero() {
_, _ = w.w.Write([]byte(ansi.SetHyperlink(w.link.URL, w.link.Params)))
}
if !w.style.IsZero() {
_, _ = w.w.Write([]byte(w.style.String()))
}
}
if start < len(p) {
_, _ = w.w.Write(p[start:])
}

return len(p), nil
Expand Down
Loading
Loading