annotate runtime/ftplugin/hog.vim @ 28289:cdaff4db7760 v8.2.4670

patch 8.2.4670: memory allocation failures for new tab page not tested Commit: https://github.com/vim/vim/commit/72bb47e38f6805050ed6d969f17591bed71f83d4 Author: Yegappan Lakshmanan <yegappan@yahoo.com> Date: Sun Apr 3 11:22:38 2022 +0100 patch 8.2.4670: memory allocation failures for new tab page not tested Problem: Memory allocation failures for new tab page not tested. Solution: Add tests with failing memory allocation. (Yegappan Lakshmanan, closes #10067)
author Bram Moolenaar <Bram@vim.org>
date Sun, 03 Apr 2022 12:30:03 +0200
parents 3ba0f29ba1d1
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7188
3ba0f29ba1d1 commit https://github.com/vim/vim/commit/d7464be9747fcaa8e6210e1f00a3882932df76e2
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
1 " Vim filetype plugin
3ba0f29ba1d1 commit https://github.com/vim/vim/commit/d7464be9747fcaa8e6210e1f00a3882932df76e2
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
2 " Language: hog (snort.conf)
3ba0f29ba1d1 commit https://github.com/vim/vim/commit/d7464be9747fcaa8e6210e1f00a3882932df76e2
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
3 " Maintainer: . Victor Roemer, <vroemer@badsec.org>.
3ba0f29ba1d1 commit https://github.com/vim/vim/commit/d7464be9747fcaa8e6210e1f00a3882932df76e2
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
4 " Last Change: Mar 1, 2013
3ba0f29ba1d1 commit https://github.com/vim/vim/commit/d7464be9747fcaa8e6210e1f00a3882932df76e2
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
5
3ba0f29ba1d1 commit https://github.com/vim/vim/commit/d7464be9747fcaa8e6210e1f00a3882932df76e2
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
6 if exists("b:did_ftplugin")
3ba0f29ba1d1 commit https://github.com/vim/vim/commit/d7464be9747fcaa8e6210e1f00a3882932df76e2
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
7 finish
3ba0f29ba1d1 commit https://github.com/vim/vim/commit/d7464be9747fcaa8e6210e1f00a3882932df76e2
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
8 endif
3ba0f29ba1d1 commit https://github.com/vim/vim/commit/d7464be9747fcaa8e6210e1f00a3882932df76e2
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
9 let b:did_ftplugin = 1
3ba0f29ba1d1 commit https://github.com/vim/vim/commit/d7464be9747fcaa8e6210e1f00a3882932df76e2
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
10
3ba0f29ba1d1 commit https://github.com/vim/vim/commit/d7464be9747fcaa8e6210e1f00a3882932df76e2
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
11 let s:undo_ftplugin = "setl fo< com< cms< def< inc<"
3ba0f29ba1d1 commit https://github.com/vim/vim/commit/d7464be9747fcaa8e6210e1f00a3882932df76e2
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
12
3ba0f29ba1d1 commit https://github.com/vim/vim/commit/d7464be9747fcaa8e6210e1f00a3882932df76e2
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
13 let s:cpo_save = &cpo
3ba0f29ba1d1 commit https://github.com/vim/vim/commit/d7464be9747fcaa8e6210e1f00a3882932df76e2
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
14 set cpo&vim
3ba0f29ba1d1 commit https://github.com/vim/vim/commit/d7464be9747fcaa8e6210e1f00a3882932df76e2
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
15
3ba0f29ba1d1 commit https://github.com/vim/vim/commit/d7464be9747fcaa8e6210e1f00a3882932df76e2
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
16 setlocal formatoptions=croq
3ba0f29ba1d1 commit https://github.com/vim/vim/commit/d7464be9747fcaa8e6210e1f00a3882932df76e2
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
17 setlocal comments=:#
3ba0f29ba1d1 commit https://github.com/vim/vim/commit/d7464be9747fcaa8e6210e1f00a3882932df76e2
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
18 setlocal commentstring=\c#\ %s
3ba0f29ba1d1 commit https://github.com/vim/vim/commit/d7464be9747fcaa8e6210e1f00a3882932df76e2
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
19 setlocal define=\c^\s\{-}var
3ba0f29ba1d1 commit https://github.com/vim/vim/commit/d7464be9747fcaa8e6210e1f00a3882932df76e2
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
20 setlocal include=\c^\s\{-}include
3ba0f29ba1d1 commit https://github.com/vim/vim/commit/d7464be9747fcaa8e6210e1f00a3882932df76e2
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
21
3ba0f29ba1d1 commit https://github.com/vim/vim/commit/d7464be9747fcaa8e6210e1f00a3882932df76e2
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
22 " Move around configurations
3ba0f29ba1d1 commit https://github.com/vim/vim/commit/d7464be9747fcaa8e6210e1f00a3882932df76e2
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
23 let s:hog_keyword_match = '\c^\s*\<\(preprocessor\\|config\\|output\\|include\\|ipvar\\|portvar\\|var\\|dynamicpreprocessor\\|' .
3ba0f29ba1d1 commit https://github.com/vim/vim/commit/d7464be9747fcaa8e6210e1f00a3882932df76e2
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
24 \ 'dynamicengine\\|dynamicdetection\\|activate\\|alert\\|drop\\|block\\|dynamic\\|log\\|pass\\|reject\\|sdrop\\|sblock\)\>'
3ba0f29ba1d1 commit https://github.com/vim/vim/commit/d7464be9747fcaa8e6210e1f00a3882932df76e2
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
25
3ba0f29ba1d1 commit https://github.com/vim/vim/commit/d7464be9747fcaa8e6210e1f00a3882932df76e2
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
26 exec "nnoremap <buffer><silent> ]] :call search('" . s:hog_keyword_match . "', 'W' )<CR>"
3ba0f29ba1d1 commit https://github.com/vim/vim/commit/d7464be9747fcaa8e6210e1f00a3882932df76e2
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
27 exec "nnoremap <buffer><silent> [[ :call search('" . s:hog_keyword_match . "', 'bW' )<CR>"
3ba0f29ba1d1 commit https://github.com/vim/vim/commit/d7464be9747fcaa8e6210e1f00a3882932df76e2
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
28
3ba0f29ba1d1 commit https://github.com/vim/vim/commit/d7464be9747fcaa8e6210e1f00a3882932df76e2
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
29 if exists("loaded_matchit")
3ba0f29ba1d1 commit https://github.com/vim/vim/commit/d7464be9747fcaa8e6210e1f00a3882932df76e2
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
30 let b:match_words =
3ba0f29ba1d1 commit https://github.com/vim/vim/commit/d7464be9747fcaa8e6210e1f00a3882932df76e2
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
31 \ '^\s*\<\%(preprocessor\|config\|output\|include\|ipvar\|portvar' .
3ba0f29ba1d1 commit https://github.com/vim/vim/commit/d7464be9747fcaa8e6210e1f00a3882932df76e2
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
32 \ '\|var\|dynamicpreprocessor\|dynamicengine\|dynamicdetection' .
3ba0f29ba1d1 commit https://github.com/vim/vim/commit/d7464be9747fcaa8e6210e1f00a3882932df76e2
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
33 \ '\|activate\|alert\|drop\|block\|dynamic\|log\|pass\|reject' .
3ba0f29ba1d1 commit https://github.com/vim/vim/commit/d7464be9747fcaa8e6210e1f00a3882932df76e2
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
34 \ '\|sdrop\|sblock\>\):$,\::\,:;'
3ba0f29ba1d1 commit https://github.com/vim/vim/commit/d7464be9747fcaa8e6210e1f00a3882932df76e2
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
35 let b:match_skip = 'r:\\.\{-}$\|^\s*#.\{-}$\|^\s*$'
3ba0f29ba1d1 commit https://github.com/vim/vim/commit/d7464be9747fcaa8e6210e1f00a3882932df76e2
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
36 endif
3ba0f29ba1d1 commit https://github.com/vim/vim/commit/d7464be9747fcaa8e6210e1f00a3882932df76e2
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
37
3ba0f29ba1d1 commit https://github.com/vim/vim/commit/d7464be9747fcaa8e6210e1f00a3882932df76e2
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
38 let &cpo = s:cpo_save
3ba0f29ba1d1 commit https://github.com/vim/vim/commit/d7464be9747fcaa8e6210e1f00a3882932df76e2
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
39 unlet s:cpo_save