Skip to content

FilePicker: missing space between permission and size #337

Closed
@FusionFont

Description

@FusionFont

Here's the screenshot:

image

Sample code to repro this issue:

func FilePick() (string, error) {
	theme := huh.ThemeCharm()

	keymap := huh.NewDefaultKeyMap()
	keymap.FilePicker.Open.SetEnabled(false)

	path, err := filepath.Abs(".")
	if err != nil {
		return "", fmt.Errorf("file not found: %w", err)
	}

	err = huh.NewForm(
		huh.NewGroup(
			huh.NewFilePicker().
				CurrentDirectory(path).
				Title(Header).
				Description("Pick an image file").
				Picking(true).
				AllowedTypes([]string{".jpg", ".go"}).
				DirAllowed(false).
				FileAllowed(true).
				Height(10).
				ShowHidden(true).
				ShowPermissions(true).
				ShowSize(true).
				Value(&path),
		),
	).
		WithShowHelp(ShowHelp).
		WithKeyMap(keymap).
		WithTheme(theme).
		Run()

	if err != nil {
		return "", err
	}

	fmt.Println(path)
	return path, nil
}

P.S.

What about the align style like ls -lash?

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions