From 3453b204b6a4f9d0be201dc00930c2644957f64f Mon Sep 17 00:00:00 2001 From: Gadzhi Kharkharov Date: Mon, 17 Jan 2022 01:45:24 +0300 Subject: [PATCH] trim dashes from generated git session names --- kak/filepath.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kak/filepath.go b/kak/filepath.go index b3597cc..42c6bcf 100644 --- a/kak/filepath.go +++ b/kak/filepath.go @@ -53,7 +53,9 @@ func (fp *Filepath) ParseGitDir() string { if err != nil { return "" } - return strings.TrimSpace(strings.ReplaceAll(path.Base(string(gitOut)), ".", "-")) + + sessName := strings.Trim(strings.TrimSpace(strings.ReplaceAll(path.Base(string(gitOut)), ".", "-")), "-") + return sessName } func (fp *Filepath) parse() (absName string, line, col int, err error) {