diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2018-10-26 02:50:21 +0200 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2018-10-26 02:50:21 +0200 |
commit | 112a5b76e66471654bc778a9d5038d336d9db4e5 (patch) | |
tree | e43a40845b151596c39c2590530e7cb54fdcf1f7 | |
parent | 4d7c7f96ddcb35f525f0dd4a0e46570da9f2e111 (diff) | |
download | rneovim-112a5b76e66471654bc778a9d5038d336d9db4e5.tar.gz rneovim-112a5b76e66471654bc778a9d5038d336d9db4e5.tar.bz2 rneovim-112a5b76e66471654bc778a9d5038d336d9db4e5.zip |
man.vim: lowercase title when invoked as $MANPAGER
man#init_pager() guesses the ref by the heading, which is usually
uppercase, so we don't know the correct casing. But lowercase is more
common, so use that for the buffer name instead of uppercase.
ref #9156
-rw-r--r-- | runtime/autoload/man.vim | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/runtime/autoload/man.vim b/runtime/autoload/man.vim index f4c8194b65..41c2f5a405 100644 --- a/runtime/autoload/man.vim +++ b/runtime/autoload/man.vim @@ -392,8 +392,8 @@ function! man#init_pager() abort keepjumps 1 endif lua require("man").highlight_man_page() - " This is not perfect. See `man glDrawArraysInstanced`. Since the title is - " all caps it is impossible to tell what the original capitilization was. + " Guess the ref from the heading (which is usually uppercase, so we cannot + " know the correct casing, cf. `man glDrawArraysInstanced`). let ref = substitute(matchstr(getline(1), '^[^)]\+)'), ' ', '_', 'g') try let b:man_sect = man#extract_sect_and_name_ref(ref)[0] @@ -401,7 +401,7 @@ function! man#init_pager() abort let b:man_sect = '' endtry if -1 == match(bufname('%'), 'man:\/\/') " Avoid duplicate buffers, E95. - execute 'silent file man://'.fnameescape(ref) + execute 'silent file man://'.tolower(fnameescape(ref)) endif endfunction |