view runtime/syntax/help_ru.vim @ 34074:1629cc65d78d v9.1.0006

patch 9.1.0006: is*() and to*() function may be unsafe Commit: https://github.com/vim/vim/commit/184f71cc6868a240dc872ed2852542bbc1d43e28 Author: Keith Thompson <Keith.S.Thompson@gmail.com> Date: Thu Jan 4 21:19:04 2024 +0100 patch 9.1.0006: is*() and to*() function may be unsafe Problem: is*() and to*() function may be unsafe Solution: Add SAFE_* macros and start using those instead (Keith Thompson) Use SAFE_() macros for is*() and to*() functions The standard is*() and to*() functions declared in <ctype.h> have undefined behavior for negative arguments other than EOF. If plain char is signed, passing an unchecked value from argv for from user input to one of these functions has undefined behavior. Solution: Add SAFE_*() macros that cast the argument to unsigned char. Most implementations behave sanely for negative arguments, and most character values in practice are non-negative, but it's still best to avoid undefined behavior. The change from #13347 has been omitted, as this has already been separately fixed in commit ac709e2fc0db6d31abb7da96f743c40956b60c3a (v9.0.2054) fixes: #13332 closes: #13347 Signed-off-by: Keith Thompson <Keith.S.Thompson@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
author Christian Brabandt <cb@256bit.org>
date Thu, 04 Jan 2024 21:30:04 +0100
parents babd9f1dbe12
children
line wrap: on
line source

" Vim syntax file
" Language:     Russian Vim program help files *.rux
" Maintainer:   Restorer (restorers@users.sourceforge.net DEFUNCT)
" Last Change:  04 Aprl 2017
" 

" Проверяем язык локали и установки опции 'helplang'
" Если не русский, то выходим из скрипта.
if (v:lang !~? 'ru' || v:lang !~? 'russian') && &helplang !~? 'ru'
  finish
endif

" Подсветка русских гиперссылок
syntax match helpHyperTextJump	"\\\@<!|[^"*~# |]\+|" contains=helpBar
syntax match helpHyperTextEntry	"\*[^"*|]\+\*\s"he=e-1 contains=helpStar
syntax match helpHyperTextEntry	"\*[^"*|]\+\*$" contains=helpStar

" Заголовок статьи, раздела и т. п.
syntax match helpHeadline   "^[А-ЯЁ]\{2}[ .]\=[-,А-ЯЁA-Z0-9 .()]*"

" Наименование справочника
" новый заголовок
" syntax match helpVim      "\<СПРАВОЧНИК ПО РЕДАКТОРУ VIM\>"
"старый заголовок
syntax match helpVim      "\<СПРАВОЧНИК ПО .*"
" новый заголовок
"syntax match helpVim      "\<РУКОВОДСТВО ПОЛЬЗОВАТЕЛЯ РЕДАКТОРОМ VIM\>"
"syntax match helpVim      "\<автор\%[ы:] .*$"
"старый заголовок
syntax match helpVim      "\<РУКОВОДСТВО ПОЛЬЗОВАТЕЛЯ .*"
" Подсветка примечаний в тексте, начала примеров и т.п.
syntax keyword helpNote     Примечание. Совет. Пример. Примеры:
syntax keyword helpWarning   Внимание!
" в старой версии документации
syntax keyword helpNote     Замечание:
" в старой версии документации
syntax keyword helpWarning   ВНИМАНИЕ! Предупреждение:
" Подсветка Ex-команд в документации Vim
syntax match helpCommand     "\":[A-Za-z!]\+\""hs=s+1,he=e-1
" Подсветка специальных обозначений
syntax match helpSpecial    "{[-а-яёА-ЯЁ0-9'":%#=[\]<>.,]\+}"
syntax match helpSpecial    "{[-а-яёА-ЯЁ0-9'"*+/:%#=[\]<>.,]\+}"
syntax match helpSpecial    "\s\[[-а-яё^А-ЯЁ0-9_]\{2,}]"ms=s+1
syntax match helpSpecial    "<[-а-яёА-ЯЁ0-9_]\+>"
syntax match helpSpecial    "\[диапазон]"
syntax match helpSpecial    "\[счётчик]"
syntax match helpSpecial    "\[число]"
syntax match helpSpecial    "\[+число]"
syntax match helpSpecial    "\[-число]"
syntax match helpSpecial    "\[кол-во]"
syntax match helpSpecial    "\[строка]"
syntax match helpSpecial    "\[смещение]"
syntax match helpSpecial    "\[параметр]"
syntax match helpSpecial    "\[параметры]"
syntax match helpSpecial    "CTRL-{символ}"
syntax region helpNotVi     start="{Доступно только" start="{В редкторе Vim" start="{В редакторе Vi" end="}" contains=helpLeadBlank,helpHyperTextJump
" Подсветка примечаний переводчика
syntax region helpTrnsNote  start="\[Прим. перевод." end="]" contains=helpComment
" Определение группы подсветки Ex-команд в документации Vim
"hi def link helpCommand     vimCommand
" Определение группы подсветки примечаний переводчика
hi def link helpTrnsNote    Comment
" hi def link helpTrnsNote    Comment
"
" vim: ts=8 sw=2