Do not add extra spaces to hints

This commit is contained in:
Kirill Bulatov 2023-07-03 11:17:12 +03:00
parent e017d62e92
commit 43d4f04331
2 changed files with 90 additions and 10 deletions

View file

@ -2712,16 +2712,7 @@ impl Editor {
let buffer = self.buffer.read(cx).read(cx);
let new_inlays = to_insert
.into_iter()
.map(|(position, id, hint)| {
let mut text = hint.text();
if hint.padding_right {
text.push(' ');
}
if hint.padding_left {
text.insert(0, ' ');
}
(id, InlayProperties { position, text })
})
.map(|(position, id, hint)| (id, InlayProperties::new(position, &hint)))
.collect();
drop(buffer);
self.display_map.update(cx, |display_map, cx| {