Mercurial > vim
annotate runtime/ftplugin/systemd.vim @ 34316:bce11c34ef41 v9.1.0092
patch 9.1.0092: Compiler warning for missing type in scroll_event()
Commit: https://github.com/vim/vim/commit/c908371aec920b8174e40a1adb73a50e326a5668
Author: Christian Brabandt <cb@256bit.org>
Date: Sat Feb 10 13:17:16 2024 +0100
patch 9.1.0092: Compiler warning for missing type in scroll_event()
Problem: Compiler warning for missing type in scroll_event()
(chdiza)
Solution: Declare display_type explicitly as integer
fixes: #14005
Signed-off-by: Christian Brabandt <cb@256bit.org>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 10 Feb 2024 13:30:03 +0100 |
parents | b59496c2797b |
children | 89b487b08b2a |
rev | line source |
---|---|
7176
30042ddff503
commit https://github.com/vim/vim/commit/60cce2fb736c8ff6fdb9603f502d3c15f1f7a25d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1 " Vim filetype plugin file |
20115 | 2 " Language: systemd.unit(5) |
3 " Keyword Lookup Support: Enno Nagel <enno.nagel+vim@gmail.com> | |
33508
c252fbfde41d
runtime: make command name for &iskeywordprg more unique (#13297)
Christian Brabandt <cb@256bit.org>
parents:
33074
diff
changeset
|
4 " Latest Revision: 2023-10-07 |
7176
30042ddff503
commit https://github.com/vim/vim/commit/60cce2fb736c8ff6fdb9603f502d3c15f1f7a25d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
5 |
33600
b59496c2797b
runtime(systemd): allow for overriding systemd ftplugin settings (#13373)
Christian Brabandt <cb@256bit.org>
parents:
33508
diff
changeset
|
6 if exists("b:did_ftplugin") |
b59496c2797b
runtime(systemd): allow for overriding systemd ftplugin settings (#13373)
Christian Brabandt <cb@256bit.org>
parents:
33508
diff
changeset
|
7 finish |
7176
30042ddff503
commit https://github.com/vim/vim/commit/60cce2fb736c8ff6fdb9603f502d3c15f1f7a25d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
8 endif |
33600
b59496c2797b
runtime(systemd): allow for overriding systemd ftplugin settings (#13373)
Christian Brabandt <cb@256bit.org>
parents:
33508
diff
changeset
|
9 " Looks a lot like dosini files. |
b59496c2797b
runtime(systemd): allow for overriding systemd ftplugin settings (#13373)
Christian Brabandt <cb@256bit.org>
parents:
33508
diff
changeset
|
10 runtime! ftplugin/dosini.vim |
20115 | 11 |
32976
d23645a0aca8
runtime: configure keywordpg for some file types (#5566)
Christian Brabandt <cb@256bit.org>
parents:
20115
diff
changeset
|
12 if has('unix') && executable('less') |
d23645a0aca8
runtime: configure keywordpg for some file types (#5566)
Christian Brabandt <cb@256bit.org>
parents:
20115
diff
changeset
|
13 if !has('gui_running') |
33508
c252fbfde41d
runtime: make command name for &iskeywordprg more unique (#13297)
Christian Brabandt <cb@256bit.org>
parents:
33074
diff
changeset
|
14 command -buffer -nargs=1 SystemdKeywordPrg silent exe '!' . KeywordLookup_systemd(<q-args>) | redraw! |
32976
d23645a0aca8
runtime: configure keywordpg for some file types (#5566)
Christian Brabandt <cb@256bit.org>
parents:
20115
diff
changeset
|
15 elseif has('terminal') |
33508
c252fbfde41d
runtime: make command name for &iskeywordprg more unique (#13297)
Christian Brabandt <cb@256bit.org>
parents:
33074
diff
changeset
|
16 command -buffer -nargs=1 SystemdKeywordPrg silent exe 'term ' . KeywordLookup_systemd(<q-args>) |
32976
d23645a0aca8
runtime: configure keywordpg for some file types (#5566)
Christian Brabandt <cb@256bit.org>
parents:
20115
diff
changeset
|
17 endif |
33508
c252fbfde41d
runtime: make command name for &iskeywordprg more unique (#13297)
Christian Brabandt <cb@256bit.org>
parents:
33074
diff
changeset
|
18 if exists(':SystemdKeywordPrg') == 2 |
32976
d23645a0aca8
runtime: configure keywordpg for some file types (#5566)
Christian Brabandt <cb@256bit.org>
parents:
20115
diff
changeset
|
19 if !exists('*KeywordLookup_systemd') |
d23645a0aca8
runtime: configure keywordpg for some file types (#5566)
Christian Brabandt <cb@256bit.org>
parents:
20115
diff
changeset
|
20 function KeywordLookup_systemd(keyword) abort |
d23645a0aca8
runtime: configure keywordpg for some file types (#5566)
Christian Brabandt <cb@256bit.org>
parents:
20115
diff
changeset
|
21 let matches = matchlist(getline(search('\v^\s*\[\s*.+\s*\]\s*$', 'nbWz')), '\v^\s*\[\s*(\k+).*\]\s*$') |
d23645a0aca8
runtime: configure keywordpg for some file types (#5566)
Christian Brabandt <cb@256bit.org>
parents:
20115
diff
changeset
|
22 if len(matches) > 1 |
d23645a0aca8
runtime: configure keywordpg for some file types (#5566)
Christian Brabandt <cb@256bit.org>
parents:
20115
diff
changeset
|
23 let section = matches[1] |
d23645a0aca8
runtime: configure keywordpg for some file types (#5566)
Christian Brabandt <cb@256bit.org>
parents:
20115
diff
changeset
|
24 return 'LESS= MANPAGER="less --pattern=''(^|,)\s+' . a:keyword . '=$'' --hilite-search" man ' . 'systemd.' . section |
d23645a0aca8
runtime: configure keywordpg for some file types (#5566)
Christian Brabandt <cb@256bit.org>
parents:
20115
diff
changeset
|
25 else |
d23645a0aca8
runtime: configure keywordpg for some file types (#5566)
Christian Brabandt <cb@256bit.org>
parents:
20115
diff
changeset
|
26 return 'LESS= MANPAGER="less --pattern=''(^|,)\s+' . a:keyword . '=$'' --hilite-search" man ' . 'systemd' |
d23645a0aca8
runtime: configure keywordpg for some file types (#5566)
Christian Brabandt <cb@256bit.org>
parents:
20115
diff
changeset
|
27 endif |
d23645a0aca8
runtime: configure keywordpg for some file types (#5566)
Christian Brabandt <cb@256bit.org>
parents:
20115
diff
changeset
|
28 endfunction |
d23645a0aca8
runtime: configure keywordpg for some file types (#5566)
Christian Brabandt <cb@256bit.org>
parents:
20115
diff
changeset
|
29 endif |
d23645a0aca8
runtime: configure keywordpg for some file types (#5566)
Christian Brabandt <cb@256bit.org>
parents:
20115
diff
changeset
|
30 setlocal iskeyword+=- |
33508
c252fbfde41d
runtime: make command name for &iskeywordprg more unique (#13297)
Christian Brabandt <cb@256bit.org>
parents:
33074
diff
changeset
|
31 setlocal keywordprg=:SystemdKeywordPrg |
32976
d23645a0aca8
runtime: configure keywordpg for some file types (#5566)
Christian Brabandt <cb@256bit.org>
parents:
20115
diff
changeset
|
32 if !exists('b:undo_ftplugin') || empty(b:undo_ftplugin) |
d23645a0aca8
runtime: configure keywordpg for some file types (#5566)
Christian Brabandt <cb@256bit.org>
parents:
20115
diff
changeset
|
33 let b:undo_ftplugin = 'setlocal keywordprg< iskeyword<' |
d23645a0aca8
runtime: configure keywordpg for some file types (#5566)
Christian Brabandt <cb@256bit.org>
parents:
20115
diff
changeset
|
34 else |
33508
c252fbfde41d
runtime: make command name for &iskeywordprg more unique (#13297)
Christian Brabandt <cb@256bit.org>
parents:
33074
diff
changeset
|
35 let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc -buffer SystemdKeywordPrg' |
32976
d23645a0aca8
runtime: configure keywordpg for some file types (#5566)
Christian Brabandt <cb@256bit.org>
parents:
20115
diff
changeset
|
36 endif |
d23645a0aca8
runtime: configure keywordpg for some file types (#5566)
Christian Brabandt <cb@256bit.org>
parents:
20115
diff
changeset
|
37 endif |
20115 | 38 endif |