Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace line buffer contents on update #593

Open
PaddiM8 opened this issue Jan 16, 2022 · 2 comments
Open

Replace line buffer contents on update #593

PaddiM8 opened this issue Jan 16, 2022 · 2 comments

Comments

@PaddiM8
Copy link

PaddiM8 commented Jan 16, 2022

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?

@gwenn
Copy link
Collaborator

gwenn commented Jan 17, 2022

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.

@PaddiM8
Copy link
Author

PaddiM8 commented Jan 17, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants