mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-08-03 22:25:57 +00:00
run modernize
This commit is contained in:
parent
1faf786bd2
commit
6f588a0c29
30 changed files with 46 additions and 60 deletions
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue