@@ -1146,7 +1146,7 @@ var BracePairs = [][2]rune{
11461146func (b * Buffer ) GetSortedSyntaxGroupIndices (lineN int ) []int {
11471147 keys := make ([]int , 0 , len (b .Match (lineN )))
11481148 for k := range b .Match (lineN ) {
1149- keys = append (keys , k )
1149+ keys = append (keys , k + 1 )
11501150 }
11511151 sort .Ints (keys )
11521152 return keys
@@ -1157,9 +1157,9 @@ func (b *Buffer) GetSortedSyntaxGroupIndices(lineN int) []int {
11571157// This optionally accepts sorted Group indices returned from GetSortedSyntaxGroupIndices()
11581158// which can be reused on the same line.
11591159func (b * Buffer ) GetGroupAtLoc (loc Loc , sortedIndices []int ) (highlight.Group , bool ) {
1160- if sortedIndices == nil {
1160+ if sortedIndices == nil {
11611161 sortedIndices = b .GetSortedSyntaxGroupIndices (loc .Y )
1162- }
1162+ }
11631163 i := sort .SearchInts (sortedIndices , loc .X )
11641164 if i == 0 || i == len (sortedIndices ) {
11651165 return 0 , false
@@ -1217,7 +1217,7 @@ func (b *Buffer) findOpeningBrace(braceType [2]rune, start Loc) (Loc, bool) {
12171217 sortedGroups = b .GetSortedSyntaxGroupIndices (y )
12181218 sortedGroupsPopulated = true
12191219 }
1220- if ! b .isLocInStringOrComment (Loc {x , y }, sortedGroups ) {
1220+ if ! b .isLocInStringOrComment (Loc {x , y }, sortedGroups ) {
12211221 i ++
12221222 }
12231223 } else if r == braceType [0 ]{
0 commit comments