summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Milde <daniel@milde.cz>2024-04-24 16:07:35 +0200
committerDaniel Milde <daniel@milde.cz>2024-04-24 16:07:50 +0200
commit337eefece8f059678687487684580a0c73938be7 (patch)
treee103a7a93076ec55f5cf80d6bde1da9a32af29f2
parentcf98385b1e09bfa41bc567ad0686cf0fe9f4b259 (diff)
refactor: small fixes
-rw-r--r--tui/format.go4
-rw-r--r--tui/marked.go1
-rw-r--r--tui/tui.go4
-rw-r--r--tui/tui_test.go4
-rw-r--r--tui/utils.go2
5 files changed, 7 insertions, 8 deletions
diff --git a/tui/format.go b/tui/format.go
index 03d4460..5f48d99 100644
--- a/tui/format.go
+++ b/tui/format.go
@@ -21,7 +21,7 @@ const (
defaultColorBold = "[::b]"
)
-func (ui *UI) formatFileRow(item fs.Item, maxUsage int64, maxSize int64, marked, ignored bool) string {
+func (ui *UI) formatFileRow(item fs.Item, maxUsage, maxSize int64, marked, ignored bool) string {
var part int
switch {
@@ -94,7 +94,7 @@ func (ui *UI) formatFileRow(item fs.Item, maxUsage int64, maxSize int64, marked,
return row
}
-func (ui *UI) formatSize(size int64, reverseColor bool, transparentBg bool) string {
+func (ui *UI) formatSize(size int64, reverseColor, transparentBg bool) string {
var color string
if reverseColor {
if ui.UseColors {
diff --git a/tui/marked.go b/tui/marked.go
index fb5ac91..db9d3e9 100644
--- a/tui/marked.go
+++ b/tui/marked.go
@@ -52,7 +52,6 @@ func (ui *UI) deleteMarked(shouldEmpty bool) {
go func() {
for _, one := range markedItems {
-
ui.app.QueueUpdateDraw(func() {
modal.SetText(
// nolint: staticcheck // Why: fixed string
diff --git a/tui/tui.go b/tui/tui.go
index c895d3e..23d0599 100644
--- a/tui/tui.go
+++ b/tui/tui.go
@@ -207,8 +207,8 @@ func (ui *UI) SetSelectedBackgroundColor(color tcell.Color) {
// SetCurrentItemNameMaxLen sets the maximum length of the path of the currently processed item
// to be shown in the progress modal
-func (ui *UI) SetCurrentItemNameMaxLen(len int) {
- ui.currentItemNameMaxLen = len
+func (ui *UI) SetCurrentItemNameMaxLen(maxLen int) {
+ ui.currentItemNameMaxLen = maxLen
}
// UseOldSizeBar uses the old size bar (# chars) instead of the new one (unicode block elements)
diff --git a/tui/tui_test.go b/tui/tui_test.go
index 0e80d7a..33a600d 100644
--- a/tui/tui_test.go
+++ b/tui/tui_test.go
@@ -192,7 +192,7 @@ func TestDirSelected(t *testing.T) {
fin := testdir.CreateTestDir()
defer fin()
- ui := getAnalyzedPathMockedApp(t, true, true, false)
+ ui := getAnalyzedPathMockedApp(t, true, false, false)
ui.done = make(chan struct{})
ui.fileItemSelected(0, 0)
@@ -814,7 +814,7 @@ func getDevicesInfoMock() device.DevicesInfoGetter {
return mock
}
-func getAnalyzedPathMockedApp(t *testing.T, useColors, apparentSize bool, mockedAnalyzer bool) *UI {
+func getAnalyzedPathMockedApp(t *testing.T, useColors, apparentSize, mockedAnalyzer bool) *UI {
simScreen := testapp.CreateSimScreen()
defer simScreen.Fini()
diff --git a/tui/utils.go b/tui/utils.go
index 351f679..6403dbd 100644
--- a/tui/utils.go
+++ b/tui/utils.go
@@ -47,7 +47,7 @@ func getUsageGraph(part int) string {
}
func getUsageGraphOld(part int) string {
- part = part / 10
+ part /= 10
graph := "["
for i := 0; i < 10; i++ {
if part > i {