/* vi:set ts=8 sts=4 sw=4 noet: * * VIM - Vi IMproved by Bram Moolenaar * * Do ":help uganda" in Vim to read copying and usage conditions. * Do ":help credits" in Vim to see a list of people who contributed. * See README.txt for an overview of the Vim source code. *//* * help.c: functions for Vim help */#include"vim.h"/* * ":help": open a read-only window on a help file */voidex_help(exarg_T*eap){char_u*arg;char_u*tag;FILE*helpfd;// file descriptor of help fileintn;inti;win_T*wp;intnum_matches;char_u**matches;char_u*p;intempty_fnum=0;intalt_fnum=0;buf_T*buf;#ifdef FEAT_MULTI_LANGintlen;char_u*lang;#endif#ifdef FEAT_FOLDINGintold_KeyTyped=KeyTyped;#endifif(ERROR_IF_ANY_POPUP_WINDOW)return;if(eap!=NULL){// A ":help" command ends at the first LF, or at a '|' that is// followed by some text. Set nextcmd to the following command.for(arg=eap->arg;*arg;++arg){if(*arg=='\n'||*arg=='\r'||(*arg=='|'&&arg[1]!=NUL&&arg[1]!='|')){*arg++=NUL;eap->nextcmd=arg;break;}}arg=eap->arg;if(eap->forceit&&*arg==NUL&&!curbuf->b_help){emsg(_("E478: Don't panic!"));return;}if(eap->skip)// not executing commandsreturn;}elsearg=(char_u*)"";// remove trailing blanksp=arg+STRLEN(arg)-1;while(p>arg&&VIM_ISWHITE(*p)&&p[-1]!='\\')*p--=NUL;#ifdef FEAT_MULTI_LANG// Check for a specified languagelang=check_help_lang(arg);#endif// When no argument given go to the index.if(*arg==NUL)