Mercurial > vim
annotate runtime/ftplugin/systemd.vim @ 34207:5aee5855ccfe v9.1.0052
patch 9.1.0052: Patch 9.1.0041 causes regressions for users
Commit: https://github.com/vim/vim/commit/fa8c9715587a24562dd755c44dc13aef43d7d875
Author: Christian Brabandt <cb@256bit.org>
Date: Thu Jan 25 20:50:49 2024 +0100
patch 9.1.0052: Patch 9.1.0041 causes regressions for users
Problem: Patch 9.1.0041 causes regressions for users
(Gleb Fotengauer-Malinovskiy)
Solution: Revert 9.1.0041 and restore old behaviour
Revert "patch 9.1.0041: xxd -i may generate incorrect C statements"
This reverts commit 7062be13129985fe297b9a8e59c57b8f0db61b8f.
Signed-off-by: Christian Brabandt <cb@256bit.org>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Thu, 25 Jan 2024 21:00:05 +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 |