nushell / reedline

A feature-rich line editor - powering Nushell
https://docs.rs/reedline/
MIT License
549 stars 154 forks source link

readline with initialize input #810

Closed tisonkun closed 3 months ago

tisonkun commented 3 months ago

The same as rustyline's readline_with_initial.

The scenario is we accept partial inputs, like SELECT 1; SELECT, and then process SELECT 1;, while push back the rest SELECT for the next input.

tisonkun commented 3 months ago

Find a workaround state.run_edit_commands(&[EditCommand::InsertString("SELECT 1".to_string())]);,

Let me see if it's feature completed.

tisonkun commented 3 months ago

Seems work well, while such a method can be convenient.

tisonkun commented 3 months ago

The workaround now looks elegant to me. Close as no longer an issue.