kkawakam / rustyline

Readline Implementation in Rust
https://crates.io/crates/rustyline/
MIT License
1.52k stars 175 forks source link

How to instantiate ChangeSet? #713

Closed kamiyaa closed 1 year ago

kamiyaa commented 1 year ago

So it can be used in rustyline::completion::Completer::update() ?

gwenn commented 1 year ago

Currently, only rustyline can. This change was introduced by #666

kamiyaa commented 1 year ago

How does someone use rustyline::completion::Completer::update() then?

gwenn commented 1 year ago

You can implement update. But you are not supposed to use / call it! Only rustyline should call it.

kamiyaa commented 1 year ago

Resolved. Was migrating from v9 to v12.

v9 code:

completer.update(line_buffer, pos, &my_string);

v12 code:

line_buffer.set_pos(pos);
line_buffer.kill_buffer(listener);
line_buffer.insert_str(pos, &my_string, listener);
line_buffer.move_end();