From c0c3e05051de9afd3157d42aeb1dd95b0b2bdfb3 Mon Sep 17 00:00:00 2001 From: Petter Rodhelind Date: Fri, 10 May 2019 21:49:33 +0200 Subject: ui: Present filename in tag with current pwd trimmed. --- ui/tcell/window.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'ui/tcell') diff --git a/ui/tcell/window.go b/ui/tcell/window.go index b3774d2..d278082 100644 --- a/ui/tcell/window.go +++ b/ui/tcell/window.go @@ -2,6 +2,7 @@ package uitcell import ( "fmt" + "strings" "github.com/gdamore/tcell" "github.com/prodhe/poe/editor" @@ -41,8 +42,8 @@ func NewWindow(id int64) *Window { }, } - fmt.Fprintf(win.tagline, "%s Del ", - win.Name(), + fmt.Fprintf(win.tagline, "%s ", + win.TagName(), ) return win @@ -88,6 +89,10 @@ func (win *Window) Name() string { return win.body.text.Name() } +func (win *Window) TagName() string { + return strings.TrimPrefix(win.body.text.Name(), ed.WorkDir()) +} + func (win *Window) Dir() string { d := win.body.text.WorkDir() if d == "." { -- cgit v1.2.3