Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1178)

Unified Diff: mojom/mojom_parser/lexer/tokens.go

Issue 1837353002: Mojom parser: Fix snippet algorithm. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojom/mojom_parser/lexer/lexer_test.go ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojom/mojom_parser/lexer/tokens.go
diff --git a/mojom/mojom_parser/lexer/tokens.go b/mojom/mojom_parser/lexer/tokens.go
index 9fd0b412fca6ac1da56d1c6a3eb1adf9d678c05b..13bf83418a1a5f71c655d908b97d12b6a464659a 100644
--- a/mojom/mojom_parser/lexer/tokens.go
+++ b/mojom/mojom_parser/lexer/tokens.go
@@ -266,7 +266,7 @@ func (token Token) Snippet(source string, color bool) (snippet string) {
end := len(source)
for index, rune := range source[token.SourcePosBytes:] {
if rune == '\n' || runeCount >= 78 {
- end = index + begin + token.LinePosBytes
+ end = index + token.SourcePosBytes
break
}
runeCount++
« no previous file with comments | « mojom/mojom_parser/lexer/lexer_test.go ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698