Skip to content

Commit

Permalink
reset text after final drawing (before returning)
Browse files Browse the repository at this point in the history
  • Loading branch information
ynqa committed Oct 5, 2024
1 parent c64fe84 commit e131c92
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions promkit/src/preset/readline/render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,15 @@ pub struct Renderer {
impl crate::Finalizer for Renderer {
type Return = String;

fn finalize(&self) -> anyhow::Result<Self::Return> {
Ok(self
fn finalize(&mut self) -> anyhow::Result<Self::Return> {
let ret = self
.text_editor_snapshot
.after()
.texteditor
.text_without_cursor()
.to_string())
.to_string();
self.text_editor_snapshot.reset_after_to_init();
Ok(ret)
}
}

Expand Down

0 comments on commit e131c92

Please sign in to comment.