kickstart.nvim icon indicating copy to clipboard operation
kickstart.nvim copied to clipboard

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

Open sliva0 opened this issue 9 months ago • 2 comments

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 avatar Apr 11 '25 12:04 sliva0

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

sliva0 avatar Apr 11 '25 12:04 sliva0

IMO, we should remove <leader>tD mapping.

The reason is:

  • It is no more a toggle at all due to the break change in gitsigns.
  • The author of gitsigns removed the mapping.

guru245 avatar May 11 '25 10:05 guru245