From 112a5b76e66471654bc778a9d5038d336d9db4e5 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Fri, 26 Oct 2018 02:50:21 +0200 Subject: [PATCH] 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 --- runtime/autoload/man.vim | 6 +++--- 1 file 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