Skip to content

Commit

Permalink
review: remove slices package due to Go version
Browse files Browse the repository at this point in the history
Signed-off-by: Andreas Auernhammer <[email protected]>
  • Loading branch information
aead committed Jan 3, 2025
1 parent fb16c09 commit 2939e38
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"fmt"
"os"
"regexp"
"slices"
"strconv"
"strings"
"unicode"
Expand Down Expand Up @@ -343,13 +342,12 @@ func parseTmuxOptions(arg string, index int) (*tmuxOptions, error) {
tokens = append([]string{"center"}, tokens...)
}

if i := slices.Index(tokens, "border-native"); i >= 0 {
// The border option, if present, is the last one
if i != len(tokens)-1 {
return nil, errorToReturn
for i, token := range tokens {
if token == "border-native" {
tokens = append(tokens[:i], tokens[i+1:]...) // cut the 'border-native' option
opts.border = true
break
}
tokens = slices.Delete(tokens, i, i+1)
opts.border = true
}

// One size given
Expand Down

0 comments on commit 2939e38

Please sign in to comment.