Closed protiumx closed 1 year ago
For me, error occurs only when DiffviewFileHistory is followed by a path.
Can confirm this only happens when DiffviewFileHistory is called with path.
DiffviewFileHistory %
to view file history of only current file on buffer throws this error.
This happens when you configure the file history panel win_config
to be a column panel (position = "left"|"right"
) without setting a width
. So you likely have configured the panel wrong, but the plugin shouldn't throw an error in this case regardless, so I'll fix that.
To clarify, you likely have something like this in your config:
require("diffview").setup({
file_history_panel = {
win_config = {
position = "left",
height = 70,
-- Note `height` is being set here, but it's not used for column panels.
-- This is described in the docs.
},
},
})
What you want is probably:
require("diffview").setup({
file_history_panel = {
win_config = {
position = "left",
width = 70,
},
},
})
hi @sindrets !
that was the issue, I totally missed out that config when setting the position to left
.
Maybe a default value could help us avoid others on this problem?
I'm closing this, thanks! 🚀
@sindrets Calling DiffviewFileHistory
with a path e.g., DiffviewFileHistory %
still triggers the same error. I use following config:
file_history_panel = {
log_options = { -- See ':h diffview-config-log_options'
git = {
single_file = {
diff_merges = "combined",
},
multi_file = {
diff_merges = "first-parent",
},
},
hg = {
single_file = {},
multi_file = {},
},
},
win_config = { -- See ':h diffview-config-win_config'
position = "bottom",
height = 16,
win_opts = {}
},
},
@xuyangy it's definitely not the same error. File a new report using the bug report template.
Description
I haven't been able to use this for a while, I always get an error when calling
DiffviewFileHistory
Expected behavior
It should show the file git history
Actual behavior
I always get the following error
Steps to reproduce
Call command
DiffviewFileHistory
orDiffviewFileHistory %
Health check
Output of
``` 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.41.0) - WARNING Configured `hg_cmd` is not executable: 'hg' ```:checkhealth diffview
Log info
Relevant info from
``` [INFO 2023-07-09 20:52:03.817 +0200] .../site/pack/packer/opt/diffview.nvim/lua/diffview/lib.lua:74: [command call] :DiffviewFileHistory % [INFO 2023-07-09 20:52:03.906 +0200] ...opt/diffview.nvim/lua/diffview/vcs/adapters/git/init.lua:914: [FileHistory] Updating with options: { flags = { "--follow", "-n256", "--diff-merges=first-parent" }, path_args = { "stow/nvim/.config/nvim/lua/config/settings.lua" } } ```:DiffviewLog
Neovim version
Operating system and version
Darwin 22.5.0 arm64
Minimal config