Unfortunately, bestline isn't ideal to be used in rc as it is now:
To be useful in a shell, it's necessary to pass the cursor position when calling the complete function because the user might want to complete any word (token) in the current command line. I'm aware that this is a breaking change. But it might make bestline more suitable for other projects, too.
This pull request also adds a new libbestline.so target to the Makefile because the rc maintainers prefer linking against a shared library instead of copying the current state of a line editing library (at least they did in the past: https://github.com/rakitzis/rc/pull/5#issuecomment-304394764).
I have created a pull request to rakitzis/rc to integrate bestline: Support bestline for line editing #100.
Unfortunately, bestline isn't ideal to be used in rc as it is now:
To be useful in a shell, it's necessary to pass the cursor position when calling the
complete
function because the user might want to complete any word (token) in the current command line. I'm aware that this is a breaking change. But it might make bestline more suitable for other projects, too.This pull request also adds a new
libbestline.so
target to theMakefile
because therc
maintainers prefer linking against a shared library instead of copying the current state of a line editing library (at least they did in the past: https://github.com/rakitzis/rc/pull/5#issuecomment-304394764).