diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2018-01-09 10:10:22 +0100 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2018-01-09 10:10:22 +0100 |
commit | 59888b68ab68d974da36a0fae8edce6725ba2167 (patch) | |
tree | 1caa3736d10f57200129c02701f4639d49ed8c2b /runtime/autoload | |
parent | 0ed31303b576a44ecf7d2c579110f69e26f9db60 (diff) | |
parent | eb44519b5debf740f692bb4ea19ad83b29749484 (diff) | |
download | rneovim-59888b68ab68d974da36a0fae8edce6725ba2167.tar.gz rneovim-59888b68ab68d974da36a0fae8edce6725ba2167.tar.bz2 rneovim-59888b68ab68d974da36a0fae8edce6725ba2167.zip |
Merge #7623 'man.vim: highlight bold, underlined text'
Diffstat (limited to 'runtime/autoload')
-rw-r--r-- | runtime/autoload/man.vim | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/runtime/autoload/man.vim b/runtime/autoload/man.vim index af5c4dbd60..00ce1c77d7 100644 --- a/runtime/autoload/man.vim +++ b/runtime/autoload/man.vim @@ -148,7 +148,8 @@ function! s:get_page(path) abort let manwidth = empty($MANWIDTH) ? winwidth(0) : $MANWIDTH " Force MANPAGER=cat to ensure Vim is not recursively invoked (by man-db). " http://comments.gmane.org/gmane.editors.vim.devel/29085 - let cmd = ['env', 'MANPAGER=cat', 'MANWIDTH='.manwidth, 'man'] + " Set MAN_KEEP_FORMATTING so Debian man doesn't discard backspaces. + let cmd = ['env', 'MANPAGER=cat', 'MANWIDTH='.manwidth, 'MAN_KEEP_FORMATTING=1', 'man'] return s:system(cmd + (s:localfile_arg ? ['-l', a:path] : [a:path])) endfunction @@ -157,11 +158,10 @@ function! s:put_page(page) abort setlocal noreadonly silent keepjumps %delete _ silent put =a:page - " Remove all backspaced/escape characters. - execute 'silent keeppatterns keepjumps %substitute,.\b\|\e\[\d\+m,,e'.(&gdefault?'':'g') while getline(1) =~# '^\s*$' silent keepjumps 1delete _ endwhile + lua require("man").highlight_man_page() setlocal filetype=man endfunction @@ -370,13 +370,12 @@ function! s:format_candidate(path, psect) abort endfunction function! man#init_pager() abort - " Remove all backspaced/escape characters. - execute 'silent keeppatterns keepjumps %substitute,.\b\|\e\[\d\+m,,e'.(&gdefault?'':'g') if getline(1) =~# '^\s*$' silent keepjumps 1delete _ else 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. let ref = substitute(matchstr(getline(1), '^[^)]\+)'), ' ', '_', 'g') |