Rollup merge of #65120 - AnthonyMikh:fix_65119, r=estebank

Correctly estimate the required space for string in `StyledBuffer::prepend`

Fix #65119

r? @estebank
This commit is contained in:
Mazdak Farrokhzad 2019-10-08 15:45:28 +02:00 committed by GitHub
commit 153d3c3ea7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -111,7 +111,7 @@ impl StyledBuffer {
pub fn prepend(&mut self, line: usize, string: &str, style: Style) {
self.ensure_lines(line);
let string_len = string.len();
let string_len = string.chars().count();
// Push the old content over to make room for new content
for _ in 0..string_len {