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

Add option to disable newline after every command #756

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

fcoury
Copy link

@fcoury fcoury commented Dec 30, 2023

I am writing a neovim clone in Rust and the unconditional writeln()? on the readline_with method makes my whole screen scroll up every time the user enters a command.

I added a new enable_newline flag to the config, which defaults to true and created all the wrapper methods needed. Finally I changed the readline_with method to check the flag before issuing the writeln command.

@gwenn
Copy link
Collaborator

gwenn commented Dec 30, 2023

See
https://www.javadoc.io/static/org.jline/jline/3.25.0/org/jline/reader/LineReader.Option.html#ERASE_LINE_ON_FINISH
So maybe we should use an enum instead of a boolean:

enum EndMode { // TODO find a better name
    Erase,
    NewLine,
    None,    
}

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

Successfully merging this pull request may close these issues.

2 participants