aboutsummaryrefslogtreecommitdiffstats
path: root/src/i_ui.go
diff options
context:
space:
mode:
authorjoe <rbo@gmx.us>2025-08-26 19:24:18 +0200
committerjoe <rbo@gmx.us>2025-08-26 19:24:18 +0200
commit93aed08e521c7d96d3c53f207fb650b449cdb12c (patch)
treed3bf429138004692a36a4a47df137093f1393fc2 /src/i_ui.go
parentfixed (diff)
downloadhardflip-93aed08e521c7d96d3c53f207fb650b449cdb12c.tar.gz
hardflip-93aed08e521c7d96d3c53f207fb650b449cdb12c.tar.bz2
hardflip-93aed08e521c7d96d3c53f207fb650b449cdb12c.tar.xz
hardflip-93aed08e521c7d96d3c53f207fb650b449cdb12c.tar.zst
hardflip-93aed08e521c7d96d3c53f207fb650b449cdb12c.zip
fixed all errs and some other things
Diffstat (limited to 'src/i_ui.go')
-rw-r--r--src/i_ui.go12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/i_ui.go b/src/i_ui.go
index f32b214..653f333 100644
--- a/src/i_ui.go
+++ b/src/i_ui.go
@@ -43,7 +43,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*
* hardflip: src/i_ui.go
- * Tue, 26 Aug 2025 18:48:33 +0200
+ * Tue, 26 Aug 2025 18:55:49 +0200
* Joe
*
* interfacing with the user
@@ -580,9 +580,7 @@ func i_draw_insert_err_msg(ui HardUI, insert_err []error) {
i_draw_msg(ui.s, lines, ui.style[BOX_STYLE], ui.dim, " Errors ")
left, right := 1, ui.dim[W] - 1
line := ui.dim[H] - 2 - 1 - len(insert_err)
- if line < 0 {
- line = 0
- }
+ line = max(line, 0)
for _, err := range insert_err {
line += 1
err_str := fmt.Sprintf("%v", err)
@@ -596,9 +594,7 @@ func i_draw_load_error_msg(ui HardUI, load_err []error) {
i_draw_msg(ui.s, lines, ui.style[BOX_STYLE], ui.dim, " Load time errors ")
left, right := 1, ui.dim[W] - 1
line := ui.dim[H] - 2 - 1 - len(load_err)
- if line < 0 {
- line = 0
- }
+ line = max(line, 0)
for _, err := range load_err {
line += 1
err_str := fmt.Sprintf("%v", err)
@@ -715,7 +711,7 @@ func i_load_ui(data_dir string,
}
func i_init_styles(ui *HardUI, styles HardStyle) {
- for i := 0; i < STYLE_MAX + 1; i++ {
+ for i := range STYLE_MAX + 1 {
tmp := tcell.StyleDefault.Background(tcell.ColorReset)
curr_color := "default"
switch i {