Truncate long subject lines
This commit is contained in:
parent
fca7321639
commit
da62f63aad
1 changed files with 5 additions and 1 deletions
|
@ -1,9 +1,11 @@
|
||||||
package widgets
|
package widgets
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
|
|
||||||
"github.com/gdamore/tcell"
|
"github.com/gdamore/tcell"
|
||||||
|
"github.com/mattn/go-runewidth"
|
||||||
|
|
||||||
"git.sr.ht/~sircmpwn/aerc/config"
|
"git.sr.ht/~sircmpwn/aerc/config"
|
||||||
"git.sr.ht/~sircmpwn/aerc/lib"
|
"git.sr.ht/~sircmpwn/aerc/lib"
|
||||||
|
@ -84,7 +86,9 @@ func (ml *MessageList) Draw(ctx *ui.Context) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ctx.Printf(0, row, style, "%v", err)
|
ctx.Printf(0, row, style, "%v", err)
|
||||||
} else {
|
} else {
|
||||||
ctx.Printf(0, row, style, fmtStr, args...)
|
line := fmt.Sprintf(fmtStr, args...)
|
||||||
|
line = runewidth.Truncate(line, ctx.Width(), "…")
|
||||||
|
ctx.Printf(0, row, style, "%s", line)
|
||||||
}
|
}
|
||||||
|
|
||||||
row += 1
|
row += 1
|
||||||
|
|
Loading…
Reference in a new issue