Skip to content

Commit

Permalink
Don't trim comments to the right
Browse files Browse the repository at this point in the history
We use fixed-width comments to align `// gap` annotations and
the `// ...` position-visualization. With the previous behaviour
of `SourceLine._strip_comments()`, the right-padding of the `gap`
comment would be removed, leading to misaligned output.

This commit modifies comment trimming to use lstrip() only.
  • Loading branch information
hanno-becker committed Jul 10, 2024
1 parent c6930b8 commit ca3fb9d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion slothy/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def tag_callback(g):
return s

def _strip_comments(self):
self._comments = list(map(str.strip, self._comments))
self._comments = list(map(str.lstrip, self._comments))

def _trim_comments(self):
self._strip_comments()
Expand Down

0 comments on commit ca3fb9d

Please sign in to comment.