diff --git a/checks.go b/checks.go index b402987..df5019f 100644 --- a/checks.go +++ b/checks.go @@ -171,7 +171,7 @@ func checkCapital(c comment) []Issue { if state == endOfSentence && unicode.IsLower(r) { pp = append(pp, position{ line: pos.line, - column: runeToByteColumn(c.text, pos.column), + column: runeToByteColumn(c.lines[pos.line-1], pos.column), }) } state = empty diff --git a/checks_test.go b/checks_test.go index 1e3f158..a147de9 100644 --- a/checks_test.go +++ b/checks_test.go @@ -337,6 +337,17 @@ func TestCheckCapital(t *testing.T) { {Pos: token.Position{Line: 1, Column: 23}}, }, }, + { + name: "issue position column resolved from correct line", + comment: comment{ + lines: []string{"// Кириллица.", "// Issue. here."}, + text: " Кириллица.\n Issue. here.", + start: start, + }, + issues: []Issue{ + {Pos: token.Position{Line: 2, Column: 11}}, + }, + }, { name: "sentence with leading spaces", comment: comment{