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

vi key bindings: fix "*y #5100

Merged
merged 1 commit into from
Jul 23, 2018
Merged

vi key bindings: fix "*y #5100

merged 1 commit into from
Jul 23, 2018

Conversation

raichoo
Copy link
Contributor

@raichoo raichoo commented Jul 19, 2018

Description

I've had some issues with the "*y" key binding, apparently something goes wrong here when trying to paste something into my clipboard, it simply didn't do anything and the visual selection started to get confused (selection didn't really end but persisted throughout later commands). I've come up with this as a fix. Not quite sure if this exposes a deeper issue that is going on here, but for now this makes it work for me.

@raichoo
Copy link
Contributor Author

raichoo commented Jul 19, 2018

Huh, interestingly this does not seem to fix the issue completely. I've added this to my config.fish and it worked, while the above PR does not.

  bind -e -M visual '"*y'
  bind -M visual -m default '"*y' 'commandline -s | xsel -p; commandline -f end-selection force-repaint'

I'm a bit confused at the moment because I don't seem to get that change to show up properly anywhere in my installation. I'm obviously doing something wrong here. This might be a working fix but I'm currently at odds with the build system or whatever.

@raichoo
Copy link
Contributor Author

raichoo commented Jul 19, 2018

Okay, seems to work. For some reason gmake install didn't overwrite the fish_vi_key_bindings.fish. My bad, sorry for the noise.

@faho
Copy link
Member

faho commented Jul 19, 2018

Ooh, wow, that's not just something that doesn't work, it also shouldn't.

I think it actually did at one point - I faintly remember that we changed when something is taken as a bind function sometime in the 2.2 or 2.3 cycle - but it's quite unclean and prone to errors.

@raichoo: If you'd like, there's at least two more of these in the vi bindings, and the shared and default ones could also have some:

    #bind -m insert o "commandline -a \n" down-line force-repaint
    #bind -m insert O beginning-of-line "commandline -i \n" up-line force-repaint # doesn't work

which even says that it doesn't work and is commented....

and

    bind '"*P' backward-char "commandline -i ( xsel -p; echo )[1]"

@faho faho added the bug Something that's not working as intended label Jul 19, 2018
@raichoo
Copy link
Contributor Author

raichoo commented Jul 19, 2018

I'm having issues getting these to work properly. For some reason whenever I'm doing a commandline -i x after moving the cursor around (e.g. using commandline -f end-of-line) fish will insert the character at the previous position and not the updated one.

@krader1961
Copy link
Contributor

@raichoo You can't get it to work because of issue #3031.

@raichoo
Copy link
Contributor Author

raichoo commented Jul 19, 2018

Ah thanks, that makes sense.

@raichoo
Copy link
Contributor Author

raichoo commented Jul 22, 2018

So I guess the other commands should be addressed once there is a solution for this issue. I don't see how to fix these motions as it is right now. Reading in the whole input and replacing it with the modified version doesn't seem like a feasible solution for me.

@faho faho merged commit 06cd4dc into fish-shell:master Jul 23, 2018
@faho
Copy link
Member

faho commented Jul 23, 2018

Let's merge this as it is, then!

@zanchey zanchey added this to the fish-3.0 milestone Jul 23, 2018
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 17, 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.

None yet

4 participants