Prevent newlines from being needlessly appended (fixes #667)
That wrap_if_needed call would sometimes cause empty newlines to appear under otherwise already well-wrapped blocks of text. The idea is that whenever a new character is about to be appended, the current line is checked for being too long with that character included, and the character is only actually appended after the wrapper makes sure that appending it won't overflow the line by inserting a newline. This means that wrap_if_needed is only ever called before pushing the current character to records, never after, as was the case here.
This commit is contained in:
parent
7158a00f44
commit
0bdf7ad914
@ -181,7 +181,6 @@ namespace ui
|
||||
case '-':
|
||||
case '!':
|
||||
word_begins_at = -1; // reset word state
|
||||
wrap_if_needed(line_width);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user