chore: merge branch 'master' into v2-exp

This commit is contained in:
Ayman Bagabas
2024-10-21 14:16:22 -04:00
18 changed files with 140 additions and 88 deletions
+3 -10
View File
@@ -7,7 +7,7 @@ import (
"sort"
"strconv"
"strings"
"sync"
"sync/atomic"
"github.com/charmbracelet/bubbles/v2/key"
tea "github.com/charmbracelet/bubbletea/v2"
@@ -15,17 +15,10 @@ import (
"github.com/dustin/go-humanize"
)
var (
lastID int
idMtx sync.Mutex
)
var lastID int64
// Return the next ID we should use on the Model.
func nextID() int {
idMtx.Lock()
defer idMtx.Unlock()
lastID++
return lastID
return int(atomic.AddInt64(&lastID, 1))
}
// New returns a new filepicker model with default styling and key bindings.