diff --git a/flake.nix b/flake.nix index 2221bdf..7f36402 100644 --- a/flake.nix +++ b/flake.nix @@ -36,7 +36,7 @@ trap 'rm -rf "$tmpdir"' EXIT printf '#!/bin/sh\nexec "%s" --cmd "set rtp+=${ts-plugin}/runtime" --cmd "set rtp+=${diff-grammar}" "$@"\n' "$nvim_bin" > "$tmpdir/nvim" chmod +x "$tmpdir/nvim" - PATH="$tmpdir:$PATH" exec ${luaEnv}/bin/busted "$@" + NVIM_APPNAME=nvim-tmp PATH="$tmpdir:$PATH" exec ${luaEnv}/bin/busted "$@" ''; in pkgs.mkShell { diff --git a/lua/diffs/highlight.lua b/lua/diffs/highlight.lua index ed9329b..c11d440 100644 --- a/lua/diffs/highlight.lua +++ b/lua/diffs/highlight.lua @@ -636,11 +636,19 @@ function M.highlight_hunk(bufnr, ns, hunk, opts) end if opts.highlights.background and is_diff_line then + -- NOTE: must use separate extmark here https://github.com/neovim/neovim/issues/31151 pcall(vim.api.nvim_buf_set_extmark, bufnr, ns, buf_line, 0, { - line_hl_group = line_hl, - number_hl_group = opts.highlights.gutter and number_hl or nil, + end_row = buf_line + 1, + hl_group = line_hl, + hl_eol = true, priority = p.line_bg, }) + if opts.highlights.gutter then + pcall(vim.api.nvim_buf_set_extmark, bufnr, ns, buf_line, 0, { + number_hl_group = number_hl, + priority = p.line_bg, + }) + end end if is_marker and line_len > pw then