fixed an off-by-one error when presenting folded scalars
This commit is contained in:
flyx 2022-01-22 01:18:11 +01:00 committed by GitHub
parent e33c448783
commit 89e18cebfa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -326,7 +326,7 @@ proc writeFolded(c: Context, scalar: string, indentation, indentStep: int,
t.append(newline & newline)
t.append(repeat(' ', indentation + indentStep))
curPos = indentation + indentStep
elif curPos + (word.finish - word.start) > 80:
elif curPos + (word.finish - word.start + 1) > 80:
t.append(newline)
t.append(repeat(' ', indentation + indentStep))
curPos = indentation + indentStep