You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Custom mappings can be defined in the on_attach callback
And in the readme I see examples of setting a lot of keymaps in the on_attach callback.
Problem
What does not make sense to me is that at the time of calling vim.keymap or any other keymap adding api, those keymaps wouldn't work, because on_attach is called before actually computing hunks
As I understand it now the on_attach is meant to be used to skip attaching to some buffers, so moving it under update wouldn't make sense at this point, thus I propose adding a new config, which I tried to do in this PR #1146
The text was updated successfully, but these errors were encountered:
tronikelis
changed the title
Question about on_attach being called too early
Question about on_attach being called early
Nov 17, 2024
Hello,
I see in the docs it states
And in the readme I see examples of setting a lot of keymaps in the
on_attach
callback.Problem
What does not make sense to me is that at the time of calling
vim.keymap
or any other keymap adding api, those keymaps wouldn't work, becauseon_attach
is called before actually computing hunksIt's called here
gitsigns.nvim/lua/gitsigns/attach.lua
Line 329 in ac5aba6
But for keymaps to work this
update
needs to finishgitsigns.nvim/lua/gitsigns/attach.lua
Lines 366 to 367 in ac5aba6
As I understand it now the on_attach is meant to be used to skip attaching to some buffers, so moving it under update wouldn't make sense at this point, thus I propose adding a new config, which I tried to do in this PR #1146
The text was updated successfully, but these errors were encountered: