Description
Hello guys, many thanks for your plugin, its awesome. In lua/neogit/buffers/log_view/init.lua line 132 there is defined mapping of pressing "o" in normal mode. This mapping is lacking overriding option. I want to override it because my other mapping with "o" in normal mode clashes with it.
Speaking exactly, log_view popup takes GoToFile mapping from status popup and then some Lua magic happens and either my overriden GoToFile mapping is applied or open commit in browser is executed.
This clashing appears to be kinda strange: sometimes opens commit link in my browser, sometimes commit details are opened in neogit.
I think lua sometimes takes first value in the table of mappings, and sometimes the second value with the same key of "o"
I think the best and easiest way to fix that is to allow override mapping of opening commit link in browser
Neovim version
NVIM v0.11.6
Build type: RelWithDebInfo
LuaJIT 2.1.1767980792
Operating system and version
Fedora 43
Steps to reproduce
- go to some git repository
- nvim -nu minimal.lua
- open neogit log popup
:Neogit log
- pick current by pressing
l in normal mode
- press "o" in normal mode when selected some commit
NOTE: this is kinda sporadical problem, retry 3-5 times to reproduce, i think the reason is how lua resolves table with several values with the same key
Expected behavior
There shall be way to override mapping of open commit link in browser
Actual behavior
Opens either commit link in new browser tab or open commit in neovim
Minimal config
-- THIS IS MY minimal.lua content
-- Bootstrap lazy.nvim
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
if vim.v.shell_error ~= 0 then
vim.api.nvim_echo({
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
{ out, "WarningMsg" },
{ "\nPress any key to exit..." },
}, true, {})
vim.fn.getchar()
os.exit(1)
end
end
vim.opt.rtp:prepend(lazypath)
-- Make sure to setup `mapleader` and `maplocalleader` before
-- loading lazy.nvim so that mappings are correct.
-- This is also a good place to setup other settings (vim.opt)
vim.g.mapleader = " "
vim.g.maplocalleader = "\\"
-- Setup lazy.nvim
require("lazy").setup({
spec = {
{
"NeogitOrg/neogit",
dependencies = {
"nvim-lua/plenary.nvim", -- required
-- Only one of these is needed.
"nvim-telescope/telescope.nvim", -- optional
},
},
},
})
local neogit = require("neogit")
neogit.setup({
log_view = {
kind = "split",
},
mappings = {
status = {
["o"] = "GoToFile",
},
},
})
Description
Hello guys, many thanks for your plugin, its awesome. In
lua/neogit/buffers/log_view/init.lualine132there is defined mapping of pressing "o" in normal mode. This mapping is lacking overriding option. I want to override it because my other mapping with "o" in normal mode clashes with it.Speaking exactly, log_view popup takes
GoToFilemapping fromstatuspopup and then some Lua magic happens and either my overridenGoToFilemapping is applied or open commit in browser is executed.This clashing appears to be kinda strange: sometimes opens commit link in my browser, sometimes commit details are opened in neogit.
I think lua sometimes takes first value in the table of mappings, and sometimes the second value with the same key of "o"
I think the best and easiest way to fix that is to allow override mapping of opening commit link in browser
Neovim version
NVIM v0.11.6
Build type: RelWithDebInfo
LuaJIT 2.1.1767980792
Operating system and version
Fedora 43
Steps to reproduce
:Neogit loglin normal modeNOTE: this is kinda sporadical problem, retry 3-5 times to reproduce, i think the reason is how lua resolves table with several values with the same key
Expected behavior
There shall be way to override mapping of open commit link in browser
Actual behavior
Opens either commit link in new browser tab or open commit in neovim
Minimal config