Skip to content

[Bug] Error while fetching completions: Vim:E5108: Error executing Lua function: ... ffview/init.lua:213: too many results to unpack #572

Open
@alexasa79

Description

@alexasa79

Description

I encounter this error every time I try to run DiffviewOpen HEAD~1 and similar commands. The full error:

Error while fetching completions: Vim:E5108: Error executing Lua function: ...ocal/share/nvim/lazy/diffview.nvim/lua/diffview/init.lua:213: too many results to unpack
stack traceback:
        [C]: in function 'unpack'
        ...ocal/share/nvim/lazy/diffview.nvim/lua/diffview/init.lua:213: in function <...ocal/share/nvim/lazy/diffview.nvim/lua/diffview/init.lua:191>
        ...ocal/share/nvim/lazy/diffview.nvim/lua/diffview/init.lua:165: in function <...ocal/share/nvim/lazy/diffview.nvim/lua/diffview/init.lua:160>
        [C]: in function 'getcompletion'
        ...im/lazy/blink.cmp/lua/blink/cmp/sources/cmdline/init.lua:91: in function <...im/lazy/blink.cmp/lua/blink/cmp/sources/cmdline/init.lua:50>
        [C]: in function 'pcall'
        ...al/share/nvim/lazy/blink.cmp/lua/blink/cmp/lib/async.lua:92: in function 'cb'
        ...al/share/nvim/lazy/blink.cmp/lua/blink/cmp/lib/async.lua:157: in function 'on_completion'
        ...al/share/nvim/lazy/blink.cmp/lua/blink/cmp/lib/async.lua:91: in function <...al/share/nvim/lazy/blink.cmp/lua/blink/cmp/lib/async.lua:90>
        [C]: in function 'pcall'
        ...al/share/nvim/lazy/blink.cmp/lua/blink/cmp/lib/async.lua:65: in function 'new'
        ...
        vim/shared.lua: in function 'tbl_map'
        ...e/nvim/lazy/blink.cmp/lua/blink/cmp/sources/lib/tree.lua:89: in function 'get_completions'
        .../nvim/lazy/blink.cmp/lua/blink/cmp/sources/lib/queue.lua:48: in function 'get_completions'
        ...e/nvim/lazy/blink.cmp/lua/blink/cmp/sources/lib/init.lua:149: in function 'request_completions'
        ...re/nvim/lazy/blink.cmp/lua/blink/cmp/completion/init.lua:20: in function 'callback'
        .../nvim/lazy/blink.cmp/lua/blink/cmp/lib/event_emitter.lua:28: in function 'emit'
        ...lazy/blink.cmp/lua/blink/cmp/completion/trigger/init.lua:270: in function 'show'
        ...lazy/blink.cmp/lua/blink/cmp/completion/trigger/init.lua:63: in function 'on_char_added'
        ...nvim/lazy/blink.cmp/lua/blink/cmp/lib/cmdline_events.lua:28: in function 'on_changed'
        ...nvim/lazy/blink.cmp/lua/blink/cmp/lib/cmdline_events.lua:48: in function <...nvim/lazy/blink.cmp/lua/blink/cmp/lib/cmdline_events.lua:47>
Error while fetching completions: Vim:E5108: Error executing Lua function: ...ocal/share/nvim/lazy/diffview.nvim/lua/diffview/init.lua:213: too many results to unpack
stack traceback:
        [C]: in function 'unpack'

This is in neovim 0.11. Perhaps somewhat relevant, I am using blink.cmp and fzf-lua. This does not preclude me from using Diffview, just gets an annoying popup.

Kindly, let me know what else you need to know.

Overall this i

Expected behavior

I did not expect an error.

Actual behavior

Getting an error message with a long backtrace.

Steps to reproduce

Start entering DiffviewOpen HEAD~1. The error shows up before finish typing HEAD.

Health check

Output of :checkhealth diffview
==============================================================================
diffview:                                   require("diffview.health").check()

Checking plugin dependencies ~
- OK nvim-web-devicons installed.

Checking VCS tools ~
- The plugin requires at least one of the supported VCS tools to be valid.
- OK Git found.
- OK Git is up-to-date. (2.43.5)
- WARNING Configured `hg_cmd` is not executable: 'hg'

Log info

Relevant info from :DiffviewLog
[INFO  2025-04-28 13:18:30.191 -0400] ...local/share/nvim/lazy/diffview.nvim/lua/diffview/lib.lua:24: [command call] :DiffviewOpen 
[INFO  2025-04-28 13:18:30.337 -0400] ...iffview.nvim/lua/diffview/scene/views/diff/diff_view.lua:488: [DiffView] Completed update for 11 files successfully (96.051 ms)
[INFO  2025-04-28 13:19:18.455 -0400] ...local/share/nvim/lazy/diffview.nvim/lua/diffview/lib.lua:24: [command call] :DiffviewOpen 
[INFO  2025-04-28 13:19:19.567 -0400] ...iffview.nvim/lua/diffview/scene/views/diff/diff_view.lua:488: [DiffView] Completed update for 0 files successfully (73.675 ms)
[INFO  2025-04-28 13:20:27.818 -0400] ...local/share/nvim/lazy/diffview.nvim/lua/diffview/lib.lua:74: [command call] :DiffviewFileHistory 
[INFO  2025-04-28 13:20:27.860 -0400] ...azy/diffview.nvim/lua/diffview/vcs/adapters/git/init.lua:884: [FileHistory] Updating with options: { flags = { "-n256", "--diff-merges=first-parent" }, path_args = {} }
[INFO  2025-04-28 13:20:28.400 -0400] ...diffview/scene/views/file_history/file_history_panel.lua:248: [FileHistory] Completed update for 256 entries successfully (540.507 ms).
[INFO  2025-04-28 13:32:11.102 -0400] ...local/share/nvim/lazy/diffview.nvim/lua/diffview/lib.lua:24: [command call] :DiffviewOpen HEAD~1
[INFO  2025-04-28 13:32:12.194 -0400] ...iffview.nvim/lua/diffview/scene/views/diff/diff_view.lua:488: [DiffView] Completed update for 2 files successfully (42.112 ms)
[INFO  2025-04-28 13:32:20.681 -0400] ...local/share/nvim/lazy/diffview.nvim/lua/diffview/lib.lua:24: [command call] :DiffviewOpen HEAD~2
[INFO  2025-04-28 13:32:21.780 -0400] ...iffview.nvim/lua/diffview/scene/views/diff/diff_view.lua:488: [DiffView] Completed update for 10 files successfully (50.210 ms)
[INFO  2025-04-28 13:32:29.134 -0400] ...local/share/nvim/lazy/diffview.nvim/lua/diffview/lib.lua:24: [command call] :DiffviewOpen HEAD~2
[INFO  2025-04-28 13:32:29.225 -0400] ...iffview.nvim/lua/diffview/scene/views/diff/diff_view.lua:488: [DiffView] Completed update for 10 files successfully (50.482 ms)
[INFO  2025-04-28 13:49:47.954 -0400] ...local/share/nvim/lazy/diffview.nvim/lua/diffview/lib.lua:24: [command call] :DiffviewOpen HEAD~2
[INFO  2025-04-28 13:49:48.041 -0400] ...iffview.nvim/lua/diffview/scene/views/diff/diff_view.lua:488: [DiffView] Completed update for 10 files successfully (48.184 ms)
[ERROR 2025-04-28 14:28:45.834 -0400] ...lazy/diffview.nvim/lua/diffview/vcs/adapters/hg/init.lua:53: [HgAdapter] Configured `hg_cmd` is not executable: 'hg'

Neovim version

NVIM v0.11.0
Build type: Release
LuaJIT 2.1.1741730670
Run "nvim -V1 -v" for more info

Operating system and version

Linux 5.14.0-503.35.1.el9_5.x86_64 x86_64 GNU/Linux

Minimal config

-- #######################################
-- ### USAGE: nvim --clean -u mini.lua ###
-- #######################################

local root = vim.fn.stdpath("run") .. "/nvim/diffview.nvim"
local plugin_dir = root .. "/plugins"
vim.fn.mkdir(plugin_dir, "p")

for _, name in ipairs({ "config", "data", "state", "cache" }) do
  vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end

local plugins = {
  { "nvim-web-devicons", url = "https://github.com/nvim-tree/nvim-web-devicons.git" },
  { "diffview.nvim", url = "https://github.com/sindrets/diffview.nvim.git" },
  -- ##################################################################
  -- ### ADD PLUGINS THAT ARE _NECESSARY_ FOR REPRODUCING THE ISSUE ###
  -- ##################################################################
}

for _, spec in ipairs(plugins) do
  local install_path = plugin_dir .. "/" .. spec[1]
  if vim.fn.isdirectory(install_path) ~= 1 then
    if spec.url then
      print(string.format("Installing '%s'...", spec[1]))
      vim.fn.system({ "git", "clone", "--depth=1", spec.url, install_path })
    end
  end
  vim.opt.runtimepath:append(spec.path or install_path)
end

require("diffview").setup({
  -- ##############################################################################
  -- ### ADD DIFFVIEW.NVIM CONFIG THAT IS _NECESSARY_ FOR REPRODUCING THE ISSUE ###
  -- ##############################################################################
})

vim.opt.termguicolors = true
vim.cmd("colorscheme " .. (vim.fn.has("nvim-0.8") == 1 and "habamax" or "slate"))

-- ############################################################################
-- ### ADD INIT.LUA SETTINGS THAT ARE _NECESSARY_ FOR REPRODUCING THE ISSUE ###
-- ############################################################################

print("Ready!")

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions