on master help sign in
Take prompt length into account.
ca80961Blaž Hrastnik
helix-term/src/ui/prompt.rs+5−4
@@ -137,9 +137,10 @@ impl Prompt {
137 }
137 }
138 }
138 }
139 }
139 }
140+ let line = area.height - 1;
140 // render buffer text
141 // render buffer text
141− surface.set_string(1, area.height - 1, &self.prompt, text_color);
142+ surface.set_string(0, line, &self.prompt, text_color);
142− surface.set_string(2, area.height - 1, &self.line, text_color);
143+ surface.set_string(self.prompt.len() as u16, line, &self.line, text_color);
143 }
144 }
144}
145}
145
146
@@ -206,8 +207,8 @@ impl Component for Prompt {
206
207
207 fn cursor_position(&self, area: Rect, ctx: &mut Context) -> Option<Position> {
208 fn cursor_position(&self, area: Rect, ctx: &mut Context) -> Option<Position> {
208 Some(Position::new(
209 Some(Position::new(
209− area.height as usize - 1,
210+ area.height as usize,
210− area.x as usize + 2 + self.cursor,
211+ area.x as usize + self.prompt.len() + self.cursor,
211 ))
212 ))
212 }
213 }
213}
214}