From f83862e6f88dffbecc5418ea44440924a75417ff Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Sat, 26 Aug 2023 01:11:11 -0400 Subject: [PATCH] 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 --- book/src/themes.md | 1 + helix-term/src/ui/document.rs | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/book/src/themes.md b/book/src/themes.md index d982dee9a..c4e733427 100644 --- a/book/src/themes.md +++ b/book/src/themes.md @@ -268,6 +268,7 @@ These scopes are used for theming the editor interface: | --- | --- | | `ui.background` | | | `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.normal` | | | `ui.cursor.insert` | | diff --git a/helix-term/src/ui/document.rs b/helix-term/src/ui/document.rs index bcbaa3519..f244da931 100644 --- a/helix-term/src/ui/document.rs +++ b/helix-term/src/ui/document.rs @@ -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); for line_decoration in &mut *line_decorations { line_decoration.render_foreground(renderer, last_line_pos, char_pos);