Small update

This commit is contained in:
2025-10-30 12:01:59 -05:00
parent 250e33f8e2
commit 4b179ba2f5

View File

@@ -23,6 +23,7 @@ package widgets
import ( import (
"fmt" "fmt"
"slices"
wh "git.bullercodeworks.com/brian/tcell-widgets/helpers" wh "git.bullercodeworks.com/brian/tcell-widgets/helpers"
"github.com/gdamore/tcell" "github.com/gdamore/tcell"
@@ -321,14 +322,7 @@ func (w *Menu) AddItems(iL ...*MenuItem) {
func (w *Menu) RemoveItems(iL ...*MenuItem) { func (w *Menu) RemoveItems(iL ...*MenuItem) {
var wrk []*MenuItem var wrk []*MenuItem
for i := range w.items { for i := range w.items {
var skip bool if slices.Contains(iL, w.items[i]) {
for j := range iL {
if w.items[i] == iL[j] {
skip = true
break
}
}
if skip {
continue continue
} }
wrk = append(wrk, w.items[i]) wrk = append(wrk, w.items[i])