Tags: julienvincent/hunk.nvim
Tags
Add keymaps to allow toggling lines on both sides Currently if you want to toggle line-by-line you need to navigate to the 'other' side of the diff to toggle the corresponding line there. The more natural experience would be to have a keymap which toggles the corresponding line (from the perspective of the current hunk) on the other side of the diff at the same time. This patch adds the keymap `toggle_line_pair` which is default mapped to `s` in normal and visual mode which exposes this behaviour.
Pass reference to `tree` when calling action fns When the tree first loads it attempts to call the `on_preview` hook. This hook currently references the `tree` var which is only bound after the tree has completed loading. This introduces a race and results in the `tree` var being nil for buffers that are opened on init. This is fixed in this change by passing an explicit reference to itself when the tree component called `on_preview`. Fixes #13
Fix diff highlight tweaks Currently the HunkDiffAddAsDelete expects the `bg` property of the DiffDelete highlight group to be present which isn't true for all colorschemes. This updates the highlight group mapping to take all properties from the DiffDelete hl group and map them to hex with proper presence checks. Fixes #8
PreviousNext