Various minor fixes

pull/6/head
Mickaël Menu 3 years ago
parent 5f88eba68f
commit fbbf8e53dc
No known key found for this signature in database
GPG Key ID: 53D73664CD359895

@ -18,5 +18,10 @@ func New() *Terminal {
// IsInteractive returns whether the app is attached to an interactive terminal
// and can prompt the user.
func (t *Terminal) IsInteractive() bool {
return !t.NoInput && isatty.IsTerminal(os.Stdin.Fd())
return !t.NoInput && t.IsTTY()
}
// IsTTY returns whether the app is attached to an interactive terminal.
func (t *Terminal) IsTTY() bool {
return isatty.IsTerminal(os.Stdin.Fd())
}

@ -80,17 +80,17 @@ func (cmd *List) Run(container *Container) error {
err = container.Paginate(cmd.NoPager, zk.Config, func(out io.Writer) error {
for i, note := range notes {
if i > 0 {
fmt.Fprintf(out, cmd.Delimiter)
fmt.Fprint(out, cmd.Delimiter)
}
ft, err := formatter.Format(note)
if err != nil {
return err
}
fmt.Fprintf(out, ft)
fmt.Fprint(out, ft)
}
if cmd.Delimiter0 {
fmt.Fprintf(out, "\x00")
fmt.Fprint(out, "\x00")
}
return nil

@ -110,7 +110,7 @@ func ParseConfig(content []byte, templatesDir string) (*Config, error) {
DefaultTitle: "Untitled",
IDOptions: IDOptions{
Charset: CharsetAlphanum,
Length: 5,
Length: 4,
Case: CaseLower,
},
},

@ -99,7 +99,7 @@ const defaultConfig = `# zk configuration file
# bat is a great tool to render Markdown document with syntax highlighting.
#https://github.com/sharkdp/bat
#fzf-preview = "bat -p --color always {1}"
#fzf-preview = "bat -p --color always {-1}"
# COMMAND ALIASES

Loading…
Cancel
Save