@@ -501,7 +501,7 @@ func (h *BufPane) HelpCmd(args []string) {
501501 }
502502}
503503
504- // VSplitCmd opens a vertical split with file given in the first argument
504+ // VSplitCmd opens one or more vertical splits with the files given as arguments
505505// If no file is given, it opens an empty buffer in a new split
506506func (h * BufPane ) VSplitCmd (args []string ) {
507507 if len (args ) == 0 {
@@ -510,16 +510,18 @@ func (h *BufPane) VSplitCmd(args []string) {
510510 return
511511 }
512512
513- buf , err := buffer .NewBufferFromFile (args [0 ], buffer .BTDefault )
514- if err != nil {
515- InfoBar .Error (err )
516- return
517- }
513+ for _ , a := range args {
514+ buf , err := buffer .NewBufferFromFile (a , buffer .BTDefault )
515+ if err != nil {
516+ InfoBar .Error (err )
517+ return
518+ }
518519
519- h .VSplitBuf (buf )
520+ h .VSplitBuf (buf )
521+ }
520522}
521523
522- // HSplitCmd opens a horizontal split with file given in the first argument
524+ // HSplitCmd opens one or more horizontal splits with the files given as arguments
523525// If no file is given, it opens an empty buffer in a new split
524526func (h * BufPane ) HSplitCmd (args []string ) {
525527 if len (args ) == 0 {
@@ -528,13 +530,15 @@ func (h *BufPane) HSplitCmd(args []string) {
528530 return
529531 }
530532
531- buf , err := buffer .NewBufferFromFile (args [0 ], buffer .BTDefault )
532- if err != nil {
533- InfoBar .Error (err )
534- return
535- }
533+ for _ , a := range args {
534+ buf , err := buffer .NewBufferFromFile (a , buffer .BTDefault )
535+ if err != nil {
536+ InfoBar .Error (err )
537+ return
538+ }
536539
537- h .HSplitBuf (buf )
540+ h .HSplitBuf (buf )
541+ }
538542}
539543
540544// EvalCmd evaluates a lua expression
0 commit comments