mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 05:49:08 +00:00
Don't print extra newline in multiline |
patterns
This commit is contained in:
parent
d1ba89f97f
commit
cab096b4e1
2 changed files with 9 additions and 1 deletions
|
@ -89,6 +89,14 @@ impl<'a> Buf<'a> {
|
|||
self.beginning_of_line = true;
|
||||
}
|
||||
|
||||
/// Ensures the current buffer ends in a newline, if it didn't already.
|
||||
/// Doesn't add a newline if the buffer already ends in one.
|
||||
pub fn ensure_ends_in_newline(&mut self) {
|
||||
if !self.text.ends_with('\n') {
|
||||
self.newline()
|
||||
}
|
||||
}
|
||||
|
||||
fn flush_spaces(&mut self) {
|
||||
if self.spaces_to_flush > 0 {
|
||||
for _ in 0..self.spaces_to_flush {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue