Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix lint issues #663

Merged
merged 1 commit into from
Nov 26, 2024
Merged
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
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ func Completion(cmd *cobra.Command, arg string) error {

// argsToFiles returns the file name from the argument.
func argsToFiles(args []string) []string {
var files []string
files := make([]string, 0, len(args))
for _, arg := range args {
argFiles, err := filepath.Glob(arg)
if err != nil {
Expand Down
6 changes: 4 additions & 2 deletions oviewer/action.go
Original file line number Diff line number Diff line change
Expand Up @@ -374,9 +374,11 @@ func (root *Root) suspend(context.Context) {
root.setMessageLog(err.Error())
return
}
defer func() error {
defer func() {
log.Println("Resume")
return root.Screen.Resume()
if err := root.Screen.Resume(); err != nil {
log.Println(err)
}
}()

subshell := os.Getenv("OV_SUBSHELL")
Expand Down
2 changes: 1 addition & 1 deletion oviewer/filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func (root *Root) filterDocument(ctx context.Context, searcher Searcher) {
writeLine(w, line)
}
go m.filterWriter(ctx, searcher, m.firstLine(), filterDoc)
root.setMessagef(msg)
root.setMessage(msg)
}

// filterWriter searches and writes to filterDoc.
Expand Down
3 changes: 1 addition & 2 deletions oviewer/oviewer.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package oviewer

import (
"context"
"errors"
"fmt"
"io"
"log"
Expand All @@ -12,8 +13,6 @@ import (
"sync"
"syscall"

"errors"

"code.rocketnine.space/tslocum/cbind"
"github.com/fsnotify/fsnotify"
"github.com/gdamore/tcell/v2"
Expand Down
20 changes: 10 additions & 10 deletions oviewer/ovstyle.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,17 +72,17 @@ func applyStyle(style tcell.Style, s OVStyle) tcell.Style {
style = style.Background(tcell.GetColor(s.Background))
}
// tcell does not support underline color.
//if s.UnderlineColor != "" {
// if s.UnderlineColor != "" {
// style = style.UnderlineColor(tcell.GetColor(s.UnderlineColor))
//}
// }
// tcell does not support underline type.
//if s.UnderlineType != 0 {
// if s.UnderlineType != 0 {
// Double,Curly,Dotted,Dashed
//}
// }
// tcell does not support vertical align type.
//if s.VerticalAlignType != 0 {
// if s.VerticalAlignType != 0 {
// Top,Middle,Bottom
//}
// }
Comment on lines 74 to +85
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here you could have removed the commented code


if s.Blink {
style = style.Blink(true)
Expand All @@ -106,9 +106,9 @@ func applyStyle(style tcell.Style, s OVStyle) tcell.Style {
style = style.StrikeThrough(true)
}
// tcell does not support overline.
//if s.OverLine {
// if s.OverLine {
// style = style.Overline(true)
//}
// }

if s.UnBlink {
style = style.Blink(false)
Expand All @@ -132,9 +132,9 @@ func applyStyle(style tcell.Style, s OVStyle) tcell.Style {
style = style.StrikeThrough(false)
}
// tcell does not support overline.
//if s.UnOverLine {
// if s.UnOverLine {
// style = style.Overline(false)
//}
// }

return style
}
Loading