Skip to content

fix: don't strip newlines in error messages#86

Merged
meowgorithm merged 4 commits intomainfrom
newline-fix
Mar 11, 2026
Merged

fix: don't strip newlines in error messages#86
meowgorithm merged 4 commits intomainfrom
newline-fix

Conversation

@meowgorithm
Copy link
Copy Markdown
Member

This fixes some behavior where newlines would be stripped in error messages.

Before:

image

After:

image

Comment thread theme.go
@meowgorithm meowgorithm force-pushed the newline-fix branch 2 times, most recently from cf11e46 to c23784c Compare March 7, 2026 17:29
Comment thread theme_test.go
Comment thread theme.go Outdated
if len(words) == 0 {
// Find the first word, skipping any leading whitespace.
start := 0
for start < len(s) && unicode.IsSpace(rune(s[start])) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure you want all space characters included in the IsSpace?

Or would you like to limit yourself to \n\r\t and space?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would be more predictable, though technically speaking this is inline with the former behavior. Could go either way here.

Comment thread theme.go
Comment thread theme.go
Comment thread theme.go
@meowgorithm meowgorithm force-pushed the newline-fix branch 2 times, most recently from ca98ba9 to c442561 Compare March 9, 2026 15:47
@meowgorithm meowgorithm merged commit d89b30a into main Mar 11, 2026
12 of 18 checks passed
@meowgorithm meowgorithm deleted the newline-fix branch March 11, 2026 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants