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

feat: git restore using git_status picker #3396

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ZenithFlux
Copy link

Description

Added an action to perform git restore on files from the git_status picker by pressing <c-r> when on a selection.

Note: Telescope takes about 1 sec to respond to <c-r>. This is an internal issue to telescope. I confirmed this by changing the keymap of git_reset_soft to <c-r>. This doesn't happen if there is some other key after <c-r>, like <c-r>s for git_reset_soft.

Closes #3012

Type of change

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list relevant details about your configuration

  • Run Telescope git_status in a local repository with some files having some modifications that are neither staged nor committed. Move the selection to one of such files and press Ctrl-R. Press Enter when a prompt asks you for confirmation. The file will be restored to its staged version, or its HEAD version if there are no staged modifications.

Configuration:

  • Neovim version (nvim --version): 0.10.1
  • Operating system and version: Linux Mint 22

Checklist:

  • My code follows the style guidelines of this project (stylua)
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (lua annotations)

@ZenithFlux
Copy link
Author

I have not updated the README. I was not sure whether I should do it since the README.md of the master is a reference for users. I think it should be updated when this feature is released.

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.

Reset File in Git Status Picker
1 participant