Skip to content

gitsigns.preview_hunk_inline is not drop-in-place replacement for gitsigns.toggle_deleted #1459

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

Open
sliva0 opened this issue Apr 11, 2025 · 1 comment

Comments

@sliva0
Copy link

sliva0 commented Apr 11, 2025

In #1321 (#1319), deprecated gitsigns.toggle_deleted function in <leader>tD keymap was replaced by gitsigns.preview_hunk_inline, which is the function to which author of the gitsigns point as a replacement, but it doesn't make a lot of sense to use it in the same way with the same keymap and description.

@@ -54,7 +54,7 @@
-        map('n', '<leader>tD', gitsigns.toggle_deleted, { desc = '[T]oggle git show [D]eleted' })
+        map('n', '<leader>tD', gitsigns.preview_hunk_inline, { desc = '[T]oggle git show [D]eleted' })
  1. It is not a toggle, it's a preview, which goes away on any key press.
  2. It is just the other style of gitsings.preview_hunk, which already has its own keymap defined (<leader>hp).

Unfortunately, there is no good replacement for original feature.

Visible resolutions:

  1. Leave this function in, change keymap to something like <leader>hP or <leader>hi, update keymap order and desc to match this change.
  2. Delete this function, optionally leave a comment about possibility of replacing gitsigns.preview_hunk with gitsigns.preview_hunk_inline.
@sliva0 sliva0 changed the title gitsigns.preview_hunk_inline is not drop-in-place replacement for gitsigns.toggle_deleted gitsigns.preview_hunk_inline is not drop-in-place replacement for gitsigns.toggle_deleted Apr 11, 2025
@sliva0
Copy link
Author

sliva0 commented Apr 11, 2025

Not a PR yet, but an issue. I think there a need to discuss how this should be fixed.

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

No branches or pull requests

1 participant