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

Show autosuggestions when (left prompt + command) exceed right prompt #7035

Merged
merged 2 commits into from May 24, 2020
Merged

Show autosuggestions when (left prompt + command) exceed right prompt #7035

merged 2 commits into from May 24, 2020

Conversation

ksralgp
Copy link
Contributor

@ksralgp ksralgp commented May 24, 2020

Description

Currently when the (left prompt + command) exceeds the right prompt autosuggestions are not shown. With this change autosuggestions are shown. Existing tests look green:

https://travis-ci.org/github/ksralgp/fish-shell/builds/690675896

Fixes issue #6948

TODOs:

  • Changes to fish usage are reflected in user documentation/manpages.
  • Tests have been added for regressions fixed
  • User-visible changes noted in CHANGELOG.md

src/screen.cpp Outdated
@@ -971,16 +973,37 @@ static screen_layout_t compute_layout(screen_t *s, size_t screen_width,
}

// Case 3
if (!done) {
calculated_width = left_prompt_width + first_command_line_width + autosuggest_total_width;
Copy link
Member

Choose a reason for hiding this comment

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

The indentation here is off, we use 4 space indents, not tabs.

See also build_tools/style.fish

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed whitespace in 812095b

@faho faho added the bug Something that's not working as intended label May 24, 2020
@faho faho added this to the fish 3.2.0 milestone May 24, 2020
@faho faho merged commit f55f98b into fish-shell:master May 24, 2020
@faho
Copy link
Member

faho commented May 24, 2020

Yeah, that works nicely. Thanks, merged!

@faho faho linked an issue May 24, 2020 that may be closed by this pull request
@ksralgp ksralgp deleted the ksralgp_6948 branch May 25, 2020 23:03
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something that's not working as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Autosuggestions do not appear when cursor passes the fish_right_prompt
2 participants