From 666d2301e7d09531068fe9898f7779c9affebb70 Mon Sep 17 00:00:00 2001 From: Petter Rodhelind Date: Thu, 4 Mar 2021 09:31:23 +0100 Subject: Add trailing separator to dirs tag without changing the actual name. The previous commit which added the trailing slash introduced a bug, where the "do not open the same buffer again if it already exists" stopped working because the actual file name did not match what was requested. --- ui/tcell/window.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'ui/tcell/window.go') diff --git a/ui/tcell/window.go b/ui/tcell/window.go index 86f9ce4..b6378be 100644 --- a/ui/tcell/window.go +++ b/ui/tcell/window.go @@ -2,6 +2,7 @@ package uitcell import ( "fmt" + "path/filepath" tcell "github.com/gdamore/tcell/v2" "github.com/prodhe/poe/editor" @@ -41,8 +42,12 @@ func NewWindow(id int64) *Window { }, } + tagname := win.TagName() + if win.body.text.IsDir() { + tagname += string(filepath.Separator) + } fmt.Fprintf(win.tagline, "%s Del Get ", - win.TagName(), + tagname, ) return win -- cgit v1.2.3