aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2018-10-26 02:50:21 +0200
committerJustin M. Keyes <justinkz@gmail.com>2018-10-26 02:50:21 +0200
commit112a5b76e66471654bc778a9d5038d336d9db4e5 (patch)
treee43a40845b151596c39c2590530e7cb54fdcf1f7
parent4d7c7f96ddcb35f525f0dd4a0e46570da9f2e111 (diff)
downloadrneovim-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.vim6
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