aboutsummaryrefslogtreecommitdiff
path: root/helix-term
diff options
context:
space:
mode:
authorBlaž Hrastnik2020-12-14 06:58:03 +0000
committerBlaž Hrastnik2020-12-14 06:58:03 +0000
commitca809617b2fb38e70910d30feefabbb21ec0ad7f (patch)
treef8a04e28fcbaa691fe2e391a5cb5c4123ef58b46 /helix-term
parented6a4c4bd240630355d1c61a1c05c4e22bf62a86 (diff)
Take prompt length into account.
Diffstat (limited to 'helix-term')
-rw-r--r--helix-term/src/ui/prompt.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/helix-term/src/ui/prompt.rs b/helix-term/src/ui/prompt.rs
index d1d92975..3ca1a941 100644
--- a/helix-term/src/ui/prompt.rs
+++ b/helix-term/src/ui/prompt.rs
@@ -137,9 +137,10 @@ impl Prompt {
}
}
}
+ let line = area.height - 1;
// render buffer text
- surface.set_string(1, area.height - 1, &self.prompt, text_color);
- surface.set_string(2, area.height - 1, &self.line, text_color);
+ surface.set_string(0, line, &self.prompt, text_color);
+ surface.set_string(self.prompt.len() as u16, line, &self.line, text_color);
}
}
@@ -206,8 +207,8 @@ impl Component for Prompt {
fn cursor_position(&self, area: Rect, ctx: &mut Context) -> Option<Position> {
Some(Position::new(
- area.height as usize - 1,
- area.x as usize + 2 + self.cursor,
+ area.height as usize,
+ area.x as usize + self.prompt.len() + self.cursor,
))
}
}