From ad6ead5e45ea904fa825c68a57ef7841e729818f Mon Sep 17 00:00:00 2001 From: Gokcehan Date: Sat, 24 Dec 2016 16:06:44 +0300 Subject: [PATCH] add a filesep option to configure file seperator Mentioned in #47. --- app.go | 2 +- comp.go | 1 + doc.go | 1 + docstring.go | 1 + eval.go | 2 ++ opts.go | 2 ++ 6 files changed, 8 insertions(+), 1 deletion(-) diff --git a/app.go b/app.go index 1240b0e..8ff6f12 100644 --- a/app.go +++ b/app.go @@ -110,7 +110,7 @@ func (app *app) exportVars() { marks := app.nav.currMarks() - envFiles := strings.Join(marks, ":") + envFiles := strings.Join(marks, gOpts.filesep) os.Setenv("f", envFile) os.Setenv("fs", envFiles) diff --git a/comp.go b/comp.go index a96ff06..f2b1400 100644 --- a/comp.go +++ b/comp.go @@ -58,6 +58,7 @@ var ( "preview!", "scrolloff", "tabstop", + "filesep", "ifs", "previewer", "shell", diff --git a/doc.go b/doc.go index dc6c9d8..812d1de 100644 --- a/doc.go +++ b/doc.go @@ -53,6 +53,7 @@ The following options can be used to customize the behavior of lf: preview bool (default on) scrolloff int (default 0) tabstop int (default 8) + filesep string (default ":") ifs string (default "") (not exported if empty) previewer string (default "") (not filtered if empty) shell string (default "$SHELL") diff --git a/docstring.go b/docstring.go index 977a02f..833f7bd 100644 --- a/docstring.go +++ b/docstring.go @@ -57,6 +57,7 @@ The following options can be used to customize the behavior of lf: preview bool (default on) scrolloff int (default 0) tabstop int (default 8) + filesep string (default ":") ifs string (default "") (not exported if empty) previewer string (default "") (not filtered if empty) shell string (default "$SHELL") diff --git a/eval.go b/eval.go index 709d2e1..355a710 100644 --- a/eval.go +++ b/eval.go @@ -69,6 +69,8 @@ func (e *setExpr) eval(app *app, args []string) { return } gOpts.tabstop = n + case "filesep": + gOpts.filesep = e.val case "ifs": gOpts.ifs = e.val case "previewer": diff --git a/opts.go b/opts.go index 0ef5840..ccd7e85 100644 --- a/opts.go +++ b/opts.go @@ -8,6 +8,7 @@ var gOpts struct { preview bool scrolloff int tabstop int + filesep string ifs string previewer string shell string @@ -25,6 +26,7 @@ func init() { gOpts.preview = true gOpts.scrolloff = 0 gOpts.tabstop = 8 + gOpts.filesep = ":" gOpts.shell = envShell gOpts.showinfo = "none" gOpts.sortby = "natural"