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

__fish_prepend_sudo: Don't move the relative position of the cursor #6542

Merged
merged 1 commit into from Jan 29, 2020
Merged

__fish_prepend_sudo: Don't move the relative position of the cursor #6542

merged 1 commit into from Jan 29, 2020

Conversation

sjohannes
Copy link
Contributor

Description

At the moment the "prepend sudo" (Alt-S) functionality always sets the cursor to the end of the line. This changes it to restore the relative position of the cursor.

The functionality was added in #6140 (0f802ea). The PR description says "This does not move the cursor", which suggests that the current behaviour is a mistake.

For example, let's say the user entered ls /root and then moved the cursor to, e.g.

ls |/root

where | is the cursor position. Running the function currently turns it to

sudo ls /root|

whereas after this change it is

sudo ls |/root

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

At the moment the "prepend sudo" functionality always sets the cursor to
the end of the line. This changes it to restore the relative position of
the cursor.
@krobelus krobelus merged commit 8e8a384 into fish-shell:master Jan 29, 2020
@krobelus
Copy link
Member

Yes, that's definitely an improvement. thank you!

@krobelus krobelus added this to the fish 3.2.0 milestone Jan 29, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants