Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ pub fn execute<H: Helper>(
// Move to end, in case cursor was in the middle of the
// line, so that next thing application prints goes after
// the input
s.edit_move_buffer_end()?;
s.move_cursor_to_end()?;
return Err(error::ReadlineError::Interrupted);
}
_ => {
Expand Down
9 changes: 9 additions & 0 deletions src/edit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,15 @@ impl<'out, 'prompt, H: Helper> State<'out, 'prompt, H> {
Ok(())
}

pub fn move_cursor_to_end(&mut self) -> Result<()> {
if self.layout.cursor == self.layout.end {
return Ok(());
}
self.out.move_cursor(self.layout.cursor, self.layout.end)?;
self.layout.cursor = self.layout.end;
Ok(())
}

pub fn move_cursor_at_leftmost(&mut self, rdr: &mut <Terminal as Term>::Reader) -> Result<()> {
self.out.move_cursor_at_leftmost(rdr)
}
Expand Down