mirror of
				https://github.com/neovim/neovim.git
				synced 2025-10-26 12:27:24 +00:00 
			
		
		
		
	man.vim: avoid duplicate buffers, E95
Before this commit, man#init_pager() always tries to scrape the manpage
name and set the buffer name. That's much less important than avoiding
duplicate buffers and E95. And it doesn't seem to be necessary, usually.
Steps to reproduce:
    $ export MANPAGER="nvim -c 'set ft=man' -"
    $ man sleep
    :Man sleep
    Error detected while processing function man#init_pager:
    line   15:
    E95: Buffer with this name already exists
    :ls!
    1  h-  "man://SLEEP(1)"               line 4
    2 %a-  "man://sleep(1)"               line 1
			
			
This commit is contained in:
		| @@ -400,7 +400,9 @@ function! man#init_pager() abort | |||||||
|   catch |   catch | ||||||
|     let b:man_sect = '' |     let b:man_sect = '' | ||||||
|   endtry |   endtry | ||||||
|  |   if -1 == match(bufname('%'), 'man:\/\/')  " Avoid duplicate buffers, E95. | ||||||
|     execute 'silent file man://'.fnameescape(ref) |     execute 'silent file man://'.fnameescape(ref) | ||||||
|  |   endif | ||||||
| endfunction | endfunction | ||||||
|  |  | ||||||
| call s:init() | call s:init() | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Justin M. Keyes
					Justin M. Keyes