Skip to content

feat(pmy.zsh): Preserve $BUFFER when fuzzy-finder-cmd failed #37

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

Merged

Conversation

Ryooooooga
Copy link
Contributor

Change to preserve $BUFFER when fuzzy-finder-cmd returns non-zero exit-code (failed or canceled).


# ~/.pmy/rules/pmy_rules.yml
- description: test
  regexp-left: ^test (?P<query>.*)
  cmd-groups:
    - stmt: echo "ABC"
      after: cat
  fuzzy-finder-cmd: fzf --exit-0 --query=<query> --height=40%
  buffer-left: 'test '
  buffer-right: '[]'
$ test XXX<C-SP>
# before
$ test   # or to avoid this, we had to set `fuzzy-finder-cmd: fzf ... || echo <query>`
# after
$ test XXX

Copy link
Owner

@relastle relastle left a comment

Choose a reason for hiding this comment

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

Very nice feature!

@relastle relastle merged commit 3ce0c11 into relastle:master Dec 25, 2020
@Ryooooooga Ryooooooga deleted the preserve-input-when-fuzzy-failed branch December 25, 2020 04:47
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