Skip to content

Commit

Permalink
Minor corrections
Browse files Browse the repository at this point in the history
Simplify logic in ui.go. In that diff, `st` would already have the
Reversed flag set; there's no need to set it again.

Also, minor changes to remove all 3 statickcheck errors VS code's
Go extension complains about.
  • Loading branch information
ilyagr committed Aug 30, 2022
1 parent b0cb926 commit dd5dc59
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
5 changes: 4 additions & 1 deletion nav.go
Original file line number Diff line number Diff line change
Expand Up @@ -1353,14 +1353,17 @@ func (nav *nav) sync() error {
}

oldmarks := nav.marks
err = nav.readMarks()
errMarks := nav.readMarks()
for _, ch := range gOpts.tempmarks {
tmp := string(ch)
if v, e := oldmarks[tmp]; e {
nav.marks[tmp] = v
}
}
err = nav.readTags()
if errMarks != nil {
return errMarks
}
return err
}

Expand Down
2 changes: 1 addition & 1 deletion server.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func listen(l net.Listener) {

func echoerr(c net.Conn, msg string) {
fmt.Fprintln(c, msg)
log.Printf(msg)
log.Print(msg)
}

func echoerrf(c net.Conn, format string, a ...interface{}) {
Expand Down
6 changes: 1 addition & 5 deletions ui.go
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ func (win *win) printDir(screen tcell.Screen, dir *dir, selections map[string]in
tag, ok := tags[path]
if ok {
if i == dir.pos {
win.print(screen, lnwidth+1, i, st.Reverse(true), tag)
win.print(screen, lnwidth+1, i, st, tag)
} else {
win.print(screen, lnwidth+1, i, tcell.StyleDefault, fmt.Sprintf(gOpts.tagfmt, tag))
}
Expand Down Expand Up @@ -611,10 +611,6 @@ func (ui *ui) echomsg(msg string) {
log.Print(msg)
}

func (ui *ui) echomsgf(format string, a ...interface{}) {
ui.echomsg(fmt.Sprintf(format, a...))
}

func (ui *ui) echoerr(msg string) {
ui.msg = fmt.Sprintf(gOpts.errorfmt, msg)
log.Printf("error: %s", msg)
Expand Down

0 comments on commit dd5dc59

Please sign in to comment.