@@ -198,12 +198,16 @@ impl EditorView {
199 // TODO: paint cursor heads except primary
199 // TODO: paint cursor heads except primary
201+ // HAXX: we don't render the char if it's offscreen. This should be
202+ // skipped in a better way much earlier
203+ if visual_x < viewport.width {
201− surface.set_string(
204+ surface.set_string(
202− viewport.x + visual_x,
205+ viewport.x + visual_x,
203− viewport.y + line,
206+ viewport.y + line,
204− grapheme,
207+ grapheme,
208 visual_x += width;
212 visual_x += width;
@@ -268,12 +272,18 @@ impl EditorView {
269 if let Some(path) = doc.relative_path() {
273 if let Some(path) = doc.relative_path() {
270 let path = path.to_string_lossy();
274 let path = path.to_string_lossy();
271− surface.set_string(viewport.x + 6, viewport.y, path, text_color);
275+ surface.set_stringn(
279+ viewport.width.saturating_sub(6) as usize,
272 // TODO: append [+] if modified
282 // TODO: append [+] if modified
275 surface.set_string(
285 surface.set_string(
276− viewport.x + viewport.width - 10,
286+ viewport.x + viewport.width.saturating_sub(10),
277 viewport.y,
287 viewport.y,
278 format!("{}", doc.diagnostics.len()),
288 format!("{}", doc.diagnostics.len()),
279 text_color,
289 text_color,