| Server IP : 121.121.20.254 / Your IP : 216.73.216.202 Web Server : Microsoft-IIS/10.0 System : Windows NT WEB-SERVER 10.0 build 20348 (Windows Server 2022) AMD64 User : IUSR ( 0) PHP Version : 8.3.28 Disable Function : NONE MySQL : ON | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/Program Files/Git/usr/share/vim/vim91/pack/dist/opt/helpcurwin/autoload/ |
Upload File : |
vim9script
# Open Vim help on {subject} in the current window (rather than a new split)
#
# Maintainer: The Vim Project <https://github.com/vim/vim>
# Last change: 2025 Dec 02
export def Open(subject: string): void
const HELPCURWIN: func = (): string => {
if !getcompletion(subject, 'help')->empty() || subject->empty()
if &buftype != 'help'
execute 'silent noautocmd keepalt enew'
setlocal buftype=help noswapfile
endif
endif
return $'help {subject}'
}
var contmod: bool = true
if &modified
echohl MoreMsg
echo $'Buffer {bufname()} is modified - continue? (y/n)'
echohl None
contmod = (getcharstr() == 'y')
endif
if contmod
try
execute HELPCURWIN()
catch
echohl Error
# {subject} invalid - Echo 'helpcurwin: E149:' (omit 'Vim(help):')
echo $'helpcurwin: {v:exception->substitute("^[^:]\+:", "", "")}'
echohl None
endtry
else
echo $'Aborted opening in current window, :help {subject}'
endif
enddef
# vim: ts=8 sts=2 sw=2 et