Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mappings not overwritten in summary window #2349

Closed
SammysHP opened this issue Oct 16, 2024 · 5 comments
Closed

Mappings not overwritten in summary window #2349

SammysHP opened this issue Oct 16, 2024 · 5 comments

Comments

@SammysHP
Copy link

Since 3d9cace, fugitive no longer overwrites previous mappings in the :Git summary window. For example, pressing <CR> does not open the file under the cursor anymore, but calls the normal mapping (:map <CR> <Plug>(wildfire-fuel) in my case).

@tpope
Copy link
Owner

tpope commented Oct 16, 2024

The net effect of that PR was to define the maps earlier, before BufReadPost rather than after. So I'd wager the problem isn't "not overwriting", it's "being overwritten". Check :verbose map <CR> for a clue as to when/where that map is created.

@SammysHP
Copy link
Author

SammysHP commented Oct 16, 2024

Just as expected:

   <CR>          <Plug>(wildfire-fuel)
        Last set from ~/***/wildfire.vim/plugin/wildfire.vim line 59

https://github.com/gcmt/wildfire.vim/blob/dfcf48aad2e80c63272df67a1b81e37cbc443412/plugin/wildfire.vim#L59

In my opinion fugitive should have higher precedence in its own "special" buffers.

@tpope
Copy link
Owner

tpope commented Oct 16, 2024

That's the entire output? I would expect to see 2 maps, a global one and a buffer local one. What's the output of :verbose map <buffer> <CR>?

@SammysHP
Copy link
Author

SammysHP commented Oct 16, 2024

Dumb me… ran it from the wrong window. Output of :verbose map <CR>, now from the fugitive summary window:

n  <CR>        *@<CR>
        Last set from ~/***/wildfire.vim/plugin/wildfire.vim line 70
   <CR>          <Plug>(wildfire-fuel)
        Last set from ~/***/wildfire.vim/plugin/wildfire.vim line 59

:verb map <buffer> <CR>:

n  <CR>        *@<CR>R>
        Last set from ~/***/wildfire.vim/plugin/wildfire.vim line 70

Likely the culprit:

https://github.com/gcmt/wildfire.vim/blob/dfcf48aad2e80c63272df67a1b81e37cbc443412/plugin/wildfire.vim#L75-L76

@tpope
Copy link
Owner

tpope commented Oct 16, 2024

So wildfire.vim, in an attempt to disable itself, is overwriting our <CR> map by mapping <CR> to <CR>. This is a bug, and not one I'm inclined to work around in Fugitive. Possibly you could work around it yourself by setting g:wildfire_fuel_map to a dummy map, and mapping <CR> yourself.

@tpope tpope closed this as completed Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants