Skip to content

Commit

Permalink
Deprecate :Gstatus q
Browse files Browse the repository at this point in the history
  • Loading branch information
tpope committed Aug 20, 2019
1 parent c63fd1b commit a510b3a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion autoload/fugitive.vim
Original file line number Diff line number Diff line change
Expand Up @@ -1838,7 +1838,7 @@ function! fugitive#BufReadStatus() abort
call s:Map('n', 'I', ":<C-U>execute <SID>StagePatch(line('.'),line('.'))<CR>", '<silent>')
call s:Map('x', 'I', ":<C-U>execute <SID>StagePatch(line(\"'<\"),line(\"'>\"))<CR>", '<silent>')
if empty(mapcheck('q', 'n'))
nnoremap <buffer> <silent> q :<C-U>if bufnr('$') == 1<Bar>quit<Bar>else<Bar>bdelete<Bar>endif<CR>
nnoremap <buffer> <silent> q :<C-U>if bufnr('$') == 1<Bar>quit<Bar>else<Bar>bdelete<Bar>endif<Bar>echohl WarningMsg<Bar>echo ':Gstatus q is deprecated in favor of gq or the built-in <C-W>q'<Bar>echohl NONE<CR>

This comment has been minimized.

Copy link
@buehmann

buehmann Aug 21, 2019

This shows me the garbled message

:Gstatus q is deprecated in favor of gq or the built-q
endif
call s:Map('n', 'gq', ":<C-U>if bufnr('$') == 1<Bar>quit<Bar>else<Bar>bdelete<Bar>endif<CR>", '<silent>')
call s:Map('n', 'R', ":echohl WarningMsg<Bar>echo 'Reloading is automatic. Use :e to force'<Bar>echohl NONE<CR>", '<silent>')
Expand Down

4 comments on commit a510b3a

@EgZvor
Copy link

@EgZvor EgZvor commented on a510b3a Oct 9, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't get this change. Personally I've never had the need to use macros in fugitive windows, they're read only anyways. Is it at least possible to make this optional?

@tpope
Copy link
Owner Author

@tpope tpope commented on a510b3a Oct 9, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Macros can still have uses in read-only buffers. Plus there's q:, etc. Not gonna make an option - rig up an autocommand to define it yourself if you need it. (Possibly Fugitive could use some better autocommand events to make this easier.)

@EgZvor
Copy link

@EgZvor EgZvor commented on a510b3a Oct 9, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In case someone else interested, I ended up with

nnoremap <buffer> q <c-w>q

in ~/.vim/after/ftplugin/fugitive.vim and ~/.vim/after/ftplugin/fugitiveblame.vim.
I was initially trying to find a function to map to, but it seems there is no "public interface" for that.

@tpope
Copy link
Owner Author

@tpope tpope commented on a510b3a Oct 9, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nmap <buffer> q gq is a quasi-public interface, but what you have is probably fine.

Please sign in to comment.