-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
revert: "man.vim: Ensure 'modifiable' in man#init_pager #11450" #17791
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
Conversation
0ed833a to
e850bf5
Compare
|
Oh yeah, also, this would prevent the goofy |
3e61907 to
574dab9
Compare
|
I think #17595 won't be fixed completely by this. The issue there is an option the user is setting in his ftplugin is being overwritten. I think moving where we set the filetype would fix the issue for all other cases as well. diff --git a/runtime/autoload/man.vim b/runtime/autoload/man.vim
index b28170b7a..0afea66a5 100644
--- a/runtime/autoload/man.vim
+++ b/runtime/autoload/man.vim
@@ -123,12 +123,12 @@ function! s:system(cmd, ...) abort
endfunction
function! s:set_options(pager) abort
- setlocal filetype=man
setlocal noswapfile buftype=nofile bufhidden=hide
setlocal nomodified readonly nomodifiable
if a:pager
nnoremap <silent> <buffer> <nowait> q :lclose<CR>:q<CR>
endif
+ setlocal filetype=man
endfunction
function! s:get_page(path) abort |
This comment was marked as off-topic.
This comment was marked as off-topic.
574dab9 to
7f0d9a7
Compare
2d045f1 to
20d22c9
Compare
20d22c9 to
0d18a38
Compare
|
No objections and agreed on the assessment. Are you going to include @muniter 's suggestion? |
|
Doh, I misunderstood @muniter's suggestion, it does in fact solve the problem of making manfiles modifiable if one wants to. Done. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please include the explanation in the commit message :) (seems like the commits should be squashed)
This reverts commit 526798a. This will make man filetype not modifiable by default, as it is the superior behavior in my opinion. More importantly, also make it possible for a user to modify man filetypes by adding `set modifiable` in `~/.config/nvim/ftplugin/man.vim` or its equivalent.
e960843 to
e41d9f4
Compare
This comment was marked as resolved.
This comment was marked as resolved.
This commit fixes the issue when neovim is opened as a pager, and q mapping causes an error. Fixes neovim#18281 Ref neovim#17791
This commit fixes the issue when neovim is opened as a pager, and q mapping causes an error. Fixes neovim#18281 Ref neovim#17791
This commit fixes the issue when neovim is opened as a pager, and q mapping causes an error. The creation of the mapping in the autoload/man.vim has been moved to the ftplugin/man.vim, and instead we set a flag in the buffer just before the filetype is set, and conditionally in the ftplugin/man.vim we set a proper mapping based on whether the buffer is a pager or not. This way these two mapping sets would not override each other. Fixes neovim#18281 Ref neovim#17791
Problem:
q in "$MANPAGER mode" does not quit Nvim. This is because
ftplugin/man.vim creates its own mapping:
nnoremap <silent> <buffer> <nowait> q :lclose<CR><C-W>c
which overrides the one set by the autoload file when using :Man!
("$MANPAGER mode")
Solution:
Set b:pager during "$MANPAGER mode" so that ftplugin/man.vim can set the
mapping correctly.
Fixes neovim#18281
Ref neovim#17791
Helped-by: Gregory Anders <[email protected]>
Problem:
q in "$MANPAGER mode" does not quit Nvim. This is because
ftplugin/man.vim creates its own mapping:
nnoremap <silent> <buffer> <nowait> q :lclose<CR><C-W>c
which overrides the one set by the autoload file when using :Man!
("$MANPAGER mode")
Solution:
Set b:pager during "$MANPAGER mode" so that ftplugin/man.vim can set the
mapping correctly.
Fixes neovim#18281
Ref neovim#17791
Helped-by: Gregory Anders <[email protected]>
Problem:
q in "$MANPAGER mode" does not quit Nvim. This is because
ftplugin/man.vim creates its own mapping:
nnoremap <silent> <buffer> <nowait> q :lclose<CR><C-W>c
which overrides the one set by the autoload file when using :Man!
("$MANPAGER mode")
Solution:
Set b:pager during "$MANPAGER mode" so that ftplugin/man.vim can set the
mapping correctly.
Fixes neovim#18281
Ref neovim#17791
Helped-by: Gregory Anders <[email protected]>
Problem:
q in "$MANPAGER mode" does not quit Nvim. This is because
ftplugin/man.vim creates its own mapping:
nnoremap <silent> <buffer> <nowait> q :lclose<CR><C-W>c
which overrides the one set by the autoload file when using :Man!
("$MANPAGER mode")
Solution:
Set b:pager during "$MANPAGER mode" so that ftplugin/man.vim can set the
mapping correctly.
Fixes neovim#18281
Ref neovim#17791
Helped-by: Gregory Anders <[email protected]>
Problem:
q in "$MANPAGER mode" does not quit Nvim. This is because
ftplugin/man.vim creates its own mapping:
nnoremap <silent> <buffer> <nowait> q :lclose<CR><C-W>c
which overrides the one set by the autoload file when using :Man!
("$MANPAGER mode")
Solution:
Set b:pager during "$MANPAGER mode" so that ftplugin/man.vim can set the
mapping correctly.
Fixes #18281
Ref #17791
Helped-by: Gregory Anders <[email protected]>
This reverts commit 526798a. This will make man filetype not modifiable by default, as it is the superior behavior in my opinion. More importantly, also make it possible for a user to modify man filetypes by adding `set modifiable` in `~/.config/nvim/ftplugin/man.vim` or its equivalent. ref neovim#11450 closes neovim#17595 Co-authored-by: Javier López <[email protected]>
Problem:
q in "$MANPAGER mode" does not quit Nvim. This is because
ftplugin/man.vim creates its own mapping:
nnoremap <silent> <buffer> <nowait> q :lclose<CR><C-W>c
which overrides the one set by the autoload file when using :Man!
("$MANPAGER mode")
Solution:
Set b:pager during "$MANPAGER mode" so that ftplugin/man.vim can set the
mapping correctly.
Fixes neovim#18281
Ref neovim#17791
Helped-by: Gregory Anders <[email protected]>
This reverts commit 526798a.
This makes manpage not modifiable, which was the original (and IMO
superior) behavior. I also find the motivation for the commit to be
kinda lackluster to begin with:
https://github.com/powerman/vim-plugin-viewdoc doesn't seem to work if
the manpage isn't modifiable. I don't think this is good enough of a
justification if I'm being honest. I obviously don't wish to block
plugins but I just don't think this is the correct solution. An ideal
solution in my mind would be something that would enable the viewdoc
plugin while still keeping the nomodifiable behavior.
Ironically, using viewdoc to read a man manpage makes the text not
modifiable lol.