Skip to content

Commit afeb82d

Browse files
committed
fix emission of closing parens
The previous attempt would not put closing parens on argumentless funcs if they returned something
1 parent 11d9417 commit afeb82d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

gocode.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"os"
1010
"path/filepath"
1111
"strconv"
12+
"strings"
1213
"time"
1314
"unicode/utf8"
1415
)
@@ -79,7 +80,7 @@ func (*VimFormatter) WriteCandidates(names, types, classes []string, num int) {
7980
word := names[i]
8081
if classes[i] == "func" {
8182
word += "("
82-
if len(types[i]) == 6 {
83+
if strings.HasPrefix(types[i], "func()") {
8384
word += ")"
8485
}
8586
}

0 commit comments

Comments
 (0)