mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-06 16:05:05 +02:00
run modernize
This commit is contained in:
@@ -105,7 +105,7 @@ type Delegate struct {
|
||||
|
||||
type Completions struct {
|
||||
Groups []*MatchGroup `json:"groups,omitempty"`
|
||||
Delegate Delegate `json:"delegate,omitempty"`
|
||||
Delegate Delegate `json:"delegate"`
|
||||
|
||||
CurrentCmd *Command `json:"-"`
|
||||
AllWords []string `json:"-"` // all words passed to parse_args()
|
||||
|
||||
@@ -7,6 +7,7 @@ import (
|
||||
"mime"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"slices"
|
||||
"strings"
|
||||
|
||||
"golang.org/x/sys/unix"
|
||||
@@ -185,13 +186,7 @@ func complete_by_fnmatch(prefix, cwd string, patterns []string) []string {
|
||||
}
|
||||
|
||||
func complete_by_mimepat(prefix, cwd string, patterns []string) []string {
|
||||
all_allowed := false
|
||||
for _, p := range patterns {
|
||||
if p == "*" {
|
||||
all_allowed = true
|
||||
break
|
||||
}
|
||||
}
|
||||
all_allowed := slices.Contains(patterns, "*")
|
||||
return fname_based_completer(prefix, cwd, func(name string) bool {
|
||||
if all_allowed {
|
||||
return true
|
||||
|
||||
@@ -19,7 +19,7 @@ var _ = fmt.Print
|
||||
type Context struct {
|
||||
fmt_ctx style.Context
|
||||
|
||||
Cyan, Green, Blue, Magenta, Red, BrightRed, Yellow, Italic, Bold, Dim, Title, Exe, Opt, Emph, Err, Code func(args ...interface{}) string
|
||||
Cyan, Green, Blue, Magenta, Red, BrightRed, Yellow, Italic, Bold, Dim, Title, Exe, Opt, Emph, Err, Code func(args ...any) string
|
||||
Url func(string, string) string
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user