mirror of
https://github.com/kovidgoyal/kitty.git
synced 2024-09-11 14:45:31 +03:00
Map should use same order of arguments as pythons map
This commit is contained in:
parent
e6d53a1921
commit
c88a171b28
@ -327,7 +327,7 @@ func theme_name_from_file_name(fname string) string {
|
||||
fname = fname[:len(fname)-len(path.Ext(fname))]
|
||||
fname = strings.ReplaceAll(fname, "_", " ")
|
||||
fname = camel_case_pat().ReplaceAllString(fname, "$1 $2")
|
||||
return strings.Join(utils.Map(strings.Split(fname, " "), strings.Title), " ")
|
||||
return strings.Join(utils.Map(strings.Title, strings.Split(fname, " ")), " ")
|
||||
}
|
||||
|
||||
func (self *Themes) AddFromFile(path string) (*Theme, error) {
|
||||
|
@ -57,7 +57,7 @@ func Filter[T any](s []T, f func(x T) bool) []T {
|
||||
return ans
|
||||
}
|
||||
|
||||
func Map[T any](s []T, f func(x T) T) []T {
|
||||
func Map[T any](f func(x T) T, s []T) []T {
|
||||
ans := make([]T, 0, len(s))
|
||||
for _, x := range s {
|
||||
ans = append(ans, f(x))
|
||||
|
Loading…
Reference in New Issue
Block a user