AmokHuginnsson / replxx

A readline and libedit replacement that supports UTF-8, syntax highlighting, hints and Windows and is BSD licensed.
Other
690 stars 108 forks source link

Multiline input history previous line crash fix #149

Open kitaisreal opened 1 year ago

kitaisreal commented 1 year ago

Replxx crashes during history previous line command, when input contains mutliple consecutive '\n' characters.

Reproducible example:

./replxx-example-cxx-api B
Welcome to Replxx
Press 'tab' to view autocompletions
Type '.help' for help
Type '.quit' or '.exit' to exit

replxx>  

replxx> 

replxx> 

replxx> replxx-example-cxx-api: replxx/src/replxx_impl.cxx:1844: int replxx::Replxx::ReplxxImpl::prev_newline_position(int) const: Assertion `( pos_ >= 0 ) && ( pos_ <= _data.length() )' failed.
Aborted (core dumped)