+ btype := buffer.BTDefault
+ if !isatty.IsTerminal(os.Stdout.Fd()) {
+ btype = buffer.BTStdout
+ }
+
+ files := make([]string, 0, len(args))
+ flagStartPos := buffer.Loc{-1, -1}
+ flagr := regexp.MustCompile(`^\+(\d+)(?::(\d+))?$`)
+ for _, a := range args {
+ match := flagr.FindStringSubmatch(a)
+ if len(match) == 3 && match[2] != "" {
+ line, err := strconv.Atoi(match[1])
+ if err != nil {
+ screen.TermMessage(err)
+ continue
+ }
+ col, err := strconv.Atoi(match[2])
+ if err != nil {
+ screen.TermMessage(err)
+ continue
+ }
+ flagStartPos = buffer.Loc{col - 1, line - 1}
+ } else if len(match) == 3 && match[2] == "" {
+ line, err := strconv.Atoi(match[1])
+ if err != nil {
+ screen.TermMessage(err)
+ continue
+ }
+ flagStartPos = buffer.Loc{0, line - 1}
+ } else {
+ files = append(files, a)
+ }
+ }
+
+ if len(files) > 0 {