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

Fixing hints when not editing at end of line #722

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/edit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@ impl<'out, 'prompt, H: Helper> State<'out, 'prompt, H> {
if self.layout.cursor == cursor {
return Ok(());
}
if self.highlight_char() {
if self.highlight_char() || self.has_hint() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why moving the cursor should invalidate the hint ?
At least, this should be configurable, not hardcoded.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my example in the initial description go the pull request the cursor is moved in steps (3) to (7). In all these positions it does not make sense to insert the remaining partial part of the hint. Try to use it with the app I uploaded https://github.com/jerbs/fsidx. It has a shell mode with hints and completions implemented for long options starting with "--". I don't see in which scenario the currently implemented behaviour is useful.

self.hint = None;
let prompt_size = self.prompt_size;
self.refresh(self.prompt, prompt_size, true, Info::NoHint)?;
} else {
Expand Down