view runtime/ftplugin/man.vim @ 34546:33cb93a8d573 v9.1.0174

patch 9.1.0174: 'cursorline' and 'wincolor' hl missing with conceal and wrap Commit: https://github.com/vim/vim/commit/21b0a3df8c4abb884489dfcc0c92b1bbe058f291 Author: zeertzjq <zeertzjq@outlook.com> Date: Wed Mar 13 20:06:34 2024 +0100 patch 9.1.0174: 'cursorline' and 'wincolor' hl missing with conceal and wrap Problem: 'cursorline' and 'wincolor' highlight missing with concealed and wrapped lines. Solution: Apply 'cursorline' and 'wincolor' highlight to boguscols. (zeertzjq) Since 'cursorline' and 'wincolor' highlight apply after the end of the line, it is more consistent to have them also apply to boguscols. Assigning MAXCOL to values in ScreenCols[] make mouse click behave the same with 'cursorline' and 'nocursorline', but such behavior may be incorrect, as it puts the cursor on the next screen line. That may be fixed in a future PR. closes: #14192 Signed-off-by: zeertzjq <zeertzjq@outlook.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
author Christian Brabandt <cb@256bit.org>
date Wed, 13 Mar 2024 20:15:03 +0100
parents b2e8663e6dcc
children 1f56105832f2
line wrap: on
line source

" Vim filetype plugin file
" Language:	man
" Maintainer:	Jason Franklin <vim@justemail.net>
" Maintainer:	SungHyun Nam <goweol@gmail.com>
" Autoload Split: Bram Moolenaar
" Last Change: 	2023 Mar 21

" To make the ":Man" command available before editing a manual page, source
" this script from your startup vimrc file.

" If 'filetype' isn't "man", we must have been called to define ":Man" and not
" to do the filetype plugin stuff.
if &filetype == "man"

  " Only do this when not done yet for this buffer
  if exists("b:did_ftplugin")
    finish
  endif
  let b:did_ftplugin = 1
endif

let s:cpo_save = &cpo
set cpo-=C

if &filetype == "man"
  " Allow hyphen, plus, colon, dot, and commercial at in manual page name.
  " Parentheses are not here but in dist#man#PreGetPage()
  setlocal iskeyword=48-57,_,a-z,A-Z,-,+,:,.,@-@
  let b:undo_ftplugin = "setlocal iskeyword<"

  " Add mappings, unless the user didn't want this.
  if !exists("no_plugin_maps") && !exists("no_man_maps")
    if !hasmapto('<Plug>ManBS')
      nmap <buffer> <LocalLeader>h <Plug>ManBS
      let b:undo_ftplugin = b:undo_ftplugin
	    \ . '|silent! nunmap <buffer> <LocalLeader>h'
    endif
    nnoremap <buffer> <Plug>ManBS :%s/.\b//g<CR>:setl nomod<CR>''

    nnoremap <buffer> <silent> <c-]> :call dist#man#PreGetPage(v:count)<CR>
    nnoremap <buffer> <silent> <c-t> :call dist#man#PopPage()<CR>
    nnoremap <buffer> <silent> q :q<CR>

    " Add undo commands for the maps
    let b:undo_ftplugin = b:undo_ftplugin
	  \ . '|silent! nunmap <buffer> <Plug>ManBS'
	  \ . '|silent! nunmap <buffer> <c-]>'
	  \ . '|silent! nunmap <buffer> <c-t>'
	  \ . '|silent! nunmap <buffer> q'
  endif

  if exists('g:ft_man_folding_enable') && (g:ft_man_folding_enable == 1)
    setlocal foldmethod=indent foldnestmax=1 foldenable
    let b:undo_ftplugin = b:undo_ftplugin
	  \ . '|silent! setl fdm< fdn< fen<'
  endif

endif

if exists(":Man") != 2
  com -nargs=+ -complete=shellcmd Man call dist#man#GetPage(<q-mods>, <f-args>)
  nmap <Leader>K :call dist#man#PreGetPage(0)<CR>
  nmap <Plug>ManPreGetPage :call dist#man#PreGetPage(0)<CR>
endif

let &cpo = s:cpo_save
unlet s:cpo_save

" vim: set sw=2 ts=8 noet: