Skip to content

Commit a544015

Browse files
authored
Use argument passed to OpenCmd without splitting (#3946)
"Split(args[0])" has been performed since "open" was added[1], but it may had been left by accident. It's unlikely desired when using the command prompt, and doesn't seem to have been added once to commands such as "vsplit" [2] which were implemented days before. [1]: 5825353 [2]: 541daf2
1 parent adfc136 commit a544015

File tree

1 file changed

+1
-13
lines changed

1 file changed

+1
-13
lines changed

internal/action/command.go

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -290,20 +290,8 @@ func (h *BufPane) PwdCmd(args []string) {
290290
// OpenCmd opens a new buffer with a given filename
291291
func (h *BufPane) OpenCmd(args []string) {
292292
if len(args) > 0 {
293-
filename := args[0]
294-
// the filename might or might not be quoted, so unquote first then join the strings.
295-
args, err := shellquote.Split(filename)
296-
if err != nil {
297-
InfoBar.Error("Error parsing args ", err)
298-
return
299-
}
300-
if len(args) == 0 {
301-
return
302-
}
303-
filename = strings.Join(args, " ")
304-
305293
open := func() {
306-
b, err := buffer.NewBufferFromFile(filename, buffer.BTDefault)
294+
b, err := buffer.NewBufferFromFile(args[0], buffer.BTDefault)
307295
if err != nil {
308296
InfoBar.Error(err)
309297
return

0 commit comments

Comments
 (0)