aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/authinfo.go10
-rw-r--r--app/dirlist.go4
-rw-r--r--app/dirtree.go4
-rw-r--r--app/getpasswd.go2
-rw-r--r--app/listbox.go8
-rw-r--r--app/pgpinfo.go2
6 files changed, 13 insertions, 17 deletions
diff --git a/app/authinfo.go b/app/authinfo.go
index d201aa8d..4e4e6e04 100644
--- a/app/authinfo.go
+++ b/app/authinfo.go
@@ -1,8 +1,6 @@
package app
import (
- "fmt"
-
"git.sr.ht/~rjarry/aerc/config"
"git.sr.ht/~rjarry/aerc/lib/auth"
"git.sr.ht/~rjarry/aerc/lib/ui"
@@ -27,11 +25,11 @@ func (a *AuthInfo) Draw(ctx *ui.Context) {
switch {
case a.authdetails == nil:
text = "(no header)"
- ctx.Printf(0, 0, defaultStyle, text)
+ ctx.Printf(0, 0, defaultStyle, "%s", text)
case a.authdetails.Err != nil:
style := a.uiConfig.GetStyle(config.STYLE_ERROR)
text = a.authdetails.Err.Error()
- ctx.Printf(0, 0, style, text)
+ ctx.Printf(0, 0, style, "%s", text)
default:
checkBounds := func(x int) bool {
return x < ctx.Width()
@@ -59,7 +57,7 @@ func (a *AuthInfo) Draw(ctx *ui.Context) {
if i > 0 {
text = " " + text
}
- x += ctx.Printf(x, 0, style, text)
+ x += ctx.Printf(x, 0, style, "%s", text)
}
}
if a.showInfo {
@@ -76,7 +74,7 @@ func (a *AuthInfo) Draw(ctx *ui.Context) {
if checkBounds(x) && infoText != "" {
if trunc := ctx.Width() - x - 3; trunc > 0 {
text = runewidth.Truncate(infoText, trunc, "…")
- ctx.Printf(x, 0, defaultStyle, fmt.Sprintf(" (%s)", text))
+ ctx.Printf(x, 0, defaultStyle, " (%s)", text)
}
}
}
diff --git a/app/dirlist.go b/app/dirlist.go
index 6c89aff9..23842e3f 100644
--- a/app/dirlist.go
+++ b/app/dirlist.go
@@ -255,7 +255,7 @@ func (dirlist *DirectoryList) Draw(ctx *ui.Context) {
if len(dirlist.dirs) == 0 {
style := uiConfig.GetStyle(config.STYLE_DIRLIST_DEFAULT)
- ctx.Printf(0, 0, style, uiConfig.EmptyDirlist)
+ ctx.Printf(0, 0, style, "%s", uiConfig.EmptyDirlist)
return
}
@@ -406,7 +406,7 @@ func (dirlist *DirectoryList) MouseEvent(localX int, localY int, event vaxis.Eve
}
func (dirlist *DirectoryList) Clicked(x int, y int) (string, bool) {
- if dirlist.dirs == nil || len(dirlist.dirs) == 0 {
+ if len(dirlist.dirs) == 0 {
return "", false
}
for i, name := range dirlist.dirs {
diff --git a/app/dirtree.go b/app/dirtree.go
index dc80fa7f..64e90193 100644
--- a/app/dirtree.go
+++ b/app/dirtree.go
@@ -99,7 +99,7 @@ func (dt *DirectoryTree) Draw(ctx *ui.Context) {
n := dt.countVisible(dt.list)
if n == 0 || dt.listIdx < 0 {
style := uiConfig.GetStyle(config.STYLE_DIRLIST_DEFAULT)
- ctx.Printf(0, 0, style, uiConfig.EmptyDirlist)
+ ctx.Printf(0, 0, style, "%s", uiConfig.EmptyDirlist)
return
}
@@ -178,7 +178,7 @@ func (dt *DirectoryTree) MouseEvent(localX int, localY int, event vaxis.Event) {
}
func (dt *DirectoryTree) Clicked(x int, y int) (string, bool) {
- if dt.list == nil || len(dt.list) == 0 || dt.countVisible(dt.list) < y+dt.Scroll() {
+ if len(dt.list) == 0 || dt.countVisible(dt.list) < y+dt.Scroll() {
return "", false
}
visible := 0
diff --git a/app/getpasswd.go b/app/getpasswd.go
index e5726d91..42934f5e 100644
--- a/app/getpasswd.go
+++ b/app/getpasswd.go
@@ -35,7 +35,7 @@ func (gp *GetPasswd) Draw(ctx *ui.Context) {
ctx.Fill(0, 0, ctx.Width(), ctx.Height(), ' ', defaultStyle)
ctx.Fill(0, 0, ctx.Width(), 1, ' ', titleStyle)
ctx.Printf(1, 0, titleStyle, "%s", gp.title)
- ctx.Printf(1, 1, defaultStyle, gp.prompt)
+ ctx.Printf(1, 1, defaultStyle, "%s", gp.prompt)
gp.input.Draw(ctx.Subcontext(1, 3, ctx.Width()-2, 1))
}
diff --git a/app/listbox.go b/app/listbox.go
index 90227122..3f3d7f37 100644
--- a/app/listbox.go
+++ b/app/listbox.go
@@ -1,7 +1,6 @@
package app
import (
- "fmt"
"math"
"strings"
"sync"
@@ -98,9 +97,8 @@ func (lb *ListBox) Draw(ctx *ui.Context) {
y := 0
if lb.showFilterField() {
y = 1
- x := ctx.Printf(0, y, defaultStyle,
- fmt.Sprintf("Filter (%d/%d): ",
- len(lb.filtered()), len(lb.lines)))
+ x := ctx.Printf(0, y, defaultStyle, "Filter (%d/%d): ",
+ len(lb.filtered()), len(lb.lines))
lb.filter.Draw(ctx.Subcontext(x, y, w-x, 1))
}
@@ -200,7 +198,7 @@ func (lb *ListBox) drawBox(ctx *ui.Context) {
}
}
}
- ctx.Printf(1, y, style, line)
+ ctx.Printf(1, y, style, "%s", line)
y += 1
}
diff --git a/app/pgpinfo.go b/app/pgpinfo.go
index d2361a01..0b2a4828 100644
--- a/app/pgpinfo.go
+++ b/app/pgpinfo.go
@@ -53,7 +53,7 @@ func (p *PGPInfo) DrawSignature(ctx *ui.Context) {
}
x := ctx.Printf(0, 0, indicatorStyle, "%s %s ", icon, indicatorText)
- ctx.Printf(x, 0, textstyle, messageText)
+ ctx.Printf(x, 0, textstyle, "%s", messageText)
}
func (p *PGPInfo) DrawEncryption(ctx *ui.Context, y int) {