aboutsummaryrefslogtreecommitdiffstats
path: root/commands
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2019-05-14 17:11:26 +0200
committerGitHub <noreply@github.com>2019-05-14 17:11:26 +0200
commit97476ff5fadaf0a457d0f0133db58415b6075940 (patch)
tree8afaedc60f81acf923931902cf6253fa59607cdf /commands
parent606a66dd6d60f46807735e2e98d080f570229e61 (diff)
parent5f0123d1385dee849d25086d0397f07d92e44a68 (diff)
downloadgit-bug-97476ff5fadaf0a457d0f0133db58415b6075940.tar.gz
Merge pull request #133 from zYeoman/patch-1
commands: ls fix CJK characters out of alignment
Diffstat (limited to 'commands')
-rw-r--r--commands/ls.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/commands/ls.go b/commands/ls.go
index 22940f2f..94f0d0d6 100644
--- a/commands/ls.go
+++ b/commands/ls.go
@@ -7,6 +7,7 @@ import (
"github.com/MichaelMure/git-bug/cache"
"github.com/MichaelMure/git-bug/util/colors"
"github.com/MichaelMure/git-bug/util/interrupt"
+ "github.com/MichaelMure/git-bug/util/text"
"github.com/spf13/cobra"
)
@@ -65,8 +66,8 @@ func runLsBug(cmd *cobra.Command, args []string) error {
}
// truncate + pad if needed
- titleFmt := fmt.Sprintf("%-50.50s", b.Title)
- authorFmt := fmt.Sprintf("%-15.15s", name)
+ titleFmt := text.LeftPadMaxLine(b.Title, 50, 0)
+ authorFmt := text.LeftPadMaxLine(name, 15, 0)
fmt.Printf("%s %s\t%s\t%s\tC:%d L:%d\n",
colors.Cyan(b.HumanId()),