rustyline icon indicating copy to clipboard operation
rustyline copied to clipboard

Replace line buffer contents on update

Open PaddiM8 opened this issue 2 years ago • 2 comments

I'm using rustyline for kalker and would like to implement automatic completion of symbols and other things like indentation, like on the web version. For me, an easy way would be to simply replace the text with the modified version everytime it's edited. This makes it fairly easy to deal with eg. indenting a line by a certain amount depending on where a certain symbol is located on the line above. I haven't found a way to do this though. Is it possible? Could it be possible in the future?

PaddiM8 avatar Jan 16 '22 19:01 PaddiM8

No there is no such thing currently in rustyline. But this feature seems to already exists in replxx: see modify_callback_t. And rustyline needs something similar to this to solve other issues. And this is where replxx calls call_modify_callback. You should also check if such feature is supported by reedline.

gwenn avatar Jan 17 '22 17:01 gwenn

I see. I will see if reedline supports it. Thanks!

PaddiM8 avatar Jan 17 '22 18:01 PaddiM8