Repository: gohugoio/hugo (language: go)

Issue:
NewContentEditor option doesn't accept arguments for editor
<!-- Please answer these questions before submitting your issue. Thanks! -->

### What version of Hugo are you using (`hugo version`)?

<pre>
$ hugo version
hugo v0.89.4+extended linux/amd64 BuildDate=unknown
</pre>

### Does this issue reproduce with the latest release?
I suppose

Some editors can be lauched with command line options. Eg Kate editor has a -s option to open file within a chosen session.
If I put
<pre>
newContentEditor: "kate -s mySessionName"
</pre>
in my `config.yml` file, I get an error
> Error: exec: "kate -s mySessionName": executable file not found in $PATH

Removing the `-s mySessionName` options makes things work as expected.
Searching about this problem, I found it should be solved since v0.77 in https://github.com/gohugoio/hugo/commit/d48a98c477a818d28008d9771050d2681e63e880, but I'm still getting the problem. Is there a regression?


Discussion / hints:
Run `which kate` in your CLI, then add the proper path to kate into your configuration. Something like `/usr/bin/kate` probably. You can _never_ assume that anything is using the same paths that you have configured in your terminal session.
Thanks @davidsneighbour for your answer.  That is not the solution. Kate is in `/usr/bin`, and I already tried to put
```
newContentEditor: "/usr/bin/kate -s mySessionName"
```
and this gives me
> Error: exec: "/usr/bin/kate -s pauavelo.fr": stat /usr/bin/kate -s mySessionName: no such file or directory

And, as I said previously, just writing 
```
newContentEditor: kate 
```
works fine, without arguments and without full path. So the path is found. The problem are the arguments.
> Is there a regression?

Yes, introduced with https://github.com/gohugoio/hugo/commit/9185e11effa682ea1ef7dc98f2943743671023a6.

Fix patch:
diff --git a/create/content.go b/create/content.go
index 6ae91288264..400cff341fa 100644
--- a/create/content.go
+++ b/create/content.go
@@ -343,15 +343,24 @@ func (b *contentBuilder) openInEditorIfConfigured(filename string) error {
 		return nil
 	}
 
-	b.h.Log.Printf("Editing %q with %q ...\n", filename, editor)
-	cmd, err := b.h.Deps.ExecHelper.New(
-		editor,
+	editorExec := strings.Fields(editor)[0]
+	editorFlags := strings.Fields(editor)[1:]
+
+	var args []interface{}
+	for _, editorFlag := range editorFlags {
+		args = append(args, editorFlag)
+	}
+	args = append(
+		args,
 		filename,
 		hexec.WithStdin(os.Stdin),
 		hexec.WithStderr(os.Stderr),
 		hexec.WithStdout(os.Stdout),
 	)
 
+	b.h.Log.Printf("Editing %q with %q ...\n", filename, editorExec)
+
+	cmd, err := b.h.Deps.ExecHelper.New(editorExec, args...)
 	if err != nil {
 		return err
 	}


Test patch: