sindrets / diffview.nvim

Single tabpage interface for easily cycling through diffs for all modified files for any git rev.
Other
3.85k stars 105 forks source link

configuration to disable binding has no effect #301

Closed engeir closed 1 year ago

engeir commented 1 year ago

I believe I have the exact opposite issue to #275.

When setting with

require("diffview").setup({
    keymaps = {
        disable_defaults = true,
    }
})

all key bindings are off, as expected (for example, g? does not show the help menu or do anything).

However, with the setting

require("diffview").setup({
    keymaps = {
        view = {
            { "n", "]x", false },
        },
    },
})

I am still able to use ]x, and it shows up in the help menu.

NeoVim version is

$ nvim -v
NVIM v0.9.0-dev-912+gfe1e6b82f
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
Compilation: /usr/bin/gcc-10 -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wdouble-promotion -Wmissing-noreturn -Wmissing-format-attribute -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fno-common -fdiagnostics-color=always -fstack-protector-strong -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_TS_HAS_SET_MATCH_LIMIT -DNVIM_TS_HAS_SET_ALLOCATOR -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DMIN_LOG_LEVEL=3 -DNVIM_UNIBI_HAS_VAR_FROM -I/home/runner/work/neovim/neovim/.deps/usr/include/luajit-2.1 -I/usr/include -I/home/runner/work/neovim/neovim/.deps/usr/include -I/home/runner/work/neovim/neovim/.deps/usr/include -I/home/runner/work/neovim/neovim/.deps/usr/include -I/home/runner/work/neovim/neovim/.deps/usr/include -I/home/runner/work/neovim/neovim/build/src/nvim/auto -I/home/runner/work/neovim/neovim/build/include -I/home/runner/work/neovim/neovim/build/cmake.config -I/home/runner/work/neovim/neovim/src -I/home/runner/work/neovim/neovim/.deps/usr/include -I/home/runner/work/neovim/neovim/.deps/usr/include -I/home/runner/work/neovim/neovim/.deps/usr/include
Compiled by runner@fv-az83-731

Features: +acl +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/share/nvim"

Run :checkhealth for more info

Diffview version:

$ git log -1
commit 11827d46e939b4748dbdb7e0df4982a63bd59d26 (HEAD -> main, origin/main, origin/HEAD)
Author: Sindre T. Strøm <sindrets@gmail.com>
Date:   Mon Feb 6 13:11:18 2023 +0100

    fix(vcs): Validate adapter after creation

    (rel. #296)
sindrets commented 1 year ago

I can't reproduce this. Are you sure you're configuring the keymaps for the correct context? The view keymaps are used inside the diff buffers.

Otherwise you're gonna have to provide a minimal config that makes this reproducible. Here's a template.

engeir commented 1 year ago

Okay, then I see what my confusion was, my mistake. Thanks!