allow optionally highlighting the area past the end of the file

this makes it easier to see when the file is actually ended, rather
than just having a bunch of whitespace near the bottom of the terminal
pull/8066/head
Jesse Luehrs 1 year ago
parent 35b6aef5fb
commit f83862e6f8

@ -268,6 +268,7 @@ These scopes are used for theming the editor interface:
| --- | --- | | --- | --- |
| `ui.background` | | | `ui.background` | |
| `ui.background.separator` | Picker separator below input line | | `ui.background.separator` | Picker separator below input line |
| `ui.background.eof` | Portion of the editor window past the end of the buffer contents |
| `ui.cursor` | | | `ui.cursor` | |
| `ui.cursor.normal` | | | `ui.cursor.normal` | |
| `ui.cursor.insert` | | | `ui.cursor.insert` | |

@ -347,6 +347,11 @@ pub fn render_text<'t>(
); );
} }
renderer.surface.set_style(
renderer.viewport.clip_top(last_line_pos.visual_line),
theme.get("ui.background.eof"),
);
renderer.draw_indent_guides(last_line_indent_level, last_line_pos.visual_line); renderer.draw_indent_guides(last_line_indent_level, last_line_pos.visual_line);
for line_decoration in &mut *line_decorations { for line_decoration in &mut *line_decorations {
line_decoration.render_foreground(renderer, last_line_pos, char_pos); line_decoration.render_foreground(renderer, last_line_pos, char_pos);

Loading…
Cancel
Save