From c22f9114c7e0874e99fd1504131423517905c9c1 Mon Sep 17 00:00:00 2001 From: "Sl@ny" Date: Wed, 28 Dec 2016 17:35:52 +0100 Subject: Implementation of Folder Jumping --- modules/templates/helper.go | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'modules') diff --git a/modules/templates/helper.go b/modules/templates/helper.go index c256455399..f65b8c6856 100644 --- a/modules/templates/helper.go +++ b/modules/templates/helper.go @@ -117,6 +117,17 @@ func NewFuncMap() []template.FuncMap { } return "tab-size-8" }, + "SubJumpablePath": func(str string) []string { + var path []string + index := strings.LastIndex(str, "/") + if index != -1 && index != len(str) { + path = append(path, string(str[0:index+1])) + path = append(path, string(str[index+1:])) + } else { + path = append(path, str) + } + return path + }, }} } -- cgit v1.2.3