diff options
author | Petter Rodhelind <petter.rodhelind@gmail.com> | 2019-05-10 21:49:33 +0200 |
---|---|---|
committer | Petter Rodhelind <petter.rodhelind@gmail.com> | 2019-05-10 21:49:33 +0200 |
commit | c0c3e05051de9afd3157d42aeb1dd95b0b2bdfb3 (patch) | |
tree | 37241624087ea410c883276dd316e18b8c30b04f /ui/tcell/window.go | |
parent | 3fda7c08d51a81f808c947d7b58f261abc363b8f (diff) | |
download | poe-c0c3e05051de9afd3157d42aeb1dd95b0b2bdfb3.tar.gz poe-c0c3e05051de9afd3157d42aeb1dd95b0b2bdfb3.tar.bz2 poe-c0c3e05051de9afd3157d42aeb1dd95b0b2bdfb3.zip |
ui: Present filename in tag with current pwd trimmed.
Diffstat (limited to 'ui/tcell/window.go')
-rw-r--r-- | ui/tcell/window.go | 9 |
1 files changed, 7 insertions, 2 deletions
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 == "." { |