diff runtime/syntax/debsources.vim @ 33670:c6d5af39dc7f

runtime(debian): update debian related runtime files (#13423) Commit: https://github.com/vim/vim/commit/7b7cda67a1246874520b280277d9b1447e1a7ef5 Author: James McCoy <jamessan@jamessan.com> Date: Thu Oct 26 17:14:30 2023 -0400 runtime(debian): update debian related runtime files (https://github.com/vim/vim/issues/13423) * Update Debian runtime files Add mantic as a supported Ubuntu release and move buster/kinetic to unsupported. Add syntax highlighting for deb822sources filetype. Add debsources ftplugin to set relevant comment options. Move common version information to shared/debversions.vim Closes #11934 Co-authored-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Co-authored-by: James Addison <jay@jp-hosting.net> Co-authored-by: Viktor Sz?pe <viktor@szepe.net> Signed-off-by: James McCoy <jamessan@jamessan.com> * Add myself as codeowner for Debian-related runtime files Signed-off-by: James McCoy <jamessan@jamessan.com> --------- Signed-off-by: James McCoy <jamessan@jamessan.com> Co-authored-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Co-authored-by: James Addison <jay@jp-hosting.net> Co-authored-by: Viktor Sz?pe <viktor@szepe.net> Signed-off-by: Christian Brabandt <cb@256bit.org>
author Christian Brabandt <cb@256bit.org>
date Thu, 26 Oct 2023 23:15:07 +0200
parents a9b5ffbc0428
children f8951966ef0c
line wrap: on
line diff
--- a/runtime/syntax/debsources.vim
+++ b/runtime/syntax/debsources.vim
@@ -2,7 +2,7 @@
 " Language:     Debian sources.list
 " Maintainer:   Debian Vim Maintainers
 " Former Maintainer: Matthijs Mohlmann <matthijs@cacholong.nl>
-" Last Change: 2023 Feb 06
+" Last Change: 2023 Oct 11
 " URL: https://salsa.debian.org/vim-team/vim-debian/blob/main/syntax/debsources.vim
 
 " Standard syntax initialization
@@ -21,41 +21,27 @@ syn match debsourcesNonFreeComponent   /
 " Match comments
 syn match debsourcesComment        /#.*/  contains=@Spell
 
-let s:cpo = &cpo
-set cpo-=C
-let s:supported = [
-      \ 'oldstable', 'stable', 'testing', 'unstable', 'experimental', 'sid', 'rc-buggy',
-      \ 'buster', 'bullseye', 'bookworm', 'trixie', 'forky',
-      \
-      \ 'trusty', 'xenial', 'bionic', 'focal', 'jammy', 'kinetic', 'lunar',
-      \ 'devel'
-      \ ]
-let s:unsupported = [
-      \ 'buzz', 'rex', 'bo', 'hamm', 'slink', 'potato',
-      \ 'woody', 'sarge', 'etch', 'lenny', 'squeeze', 'wheezy',
-      \ 'jessie', 'stretch',
-      \
-      \ 'warty', 'hoary', 'breezy', 'dapper', 'edgy', 'feisty',
-      \ 'gutsy', 'hardy', 'intrepid', 'jaunty', 'karmic', 'lucid',
-      \ 'maverick', 'natty', 'oneiric', 'precise', 'quantal', 'raring', 'saucy',
-      \ 'utopic', 'vivid', 'wily', 'yakkety', 'zesty', 'artful', 'cosmic',
-      \ 'disco', 'eoan', 'hirsute', 'impish', 'groovy'
-      \ ]
-let &cpo=s:cpo
+" Include Debian versioning information
+runtime! syntax/shared/debversions.vim
+
+exe 'syn match debsourcesDistrKeyword   +\([[:alnum:]_./]*\)\<\('. join(g:debSharedSupportedVersions, '\|'). '\)\>\([-[:alnum:]_./]*\)+'
+exe 'syn match debsourcesUnsupportedDistrKeyword +\([[:alnum:]_./]*\)\<\('. join(g:debSharedUnsupportedVersions, '\|') .'\)\>\([-[:alnum:]_./]*\)+'
+
+unlet g:debSharedSupportedVersions
+unlet g:debSharedUnsupportedVersions
 
 " Match uri's
 syn match debsourcesUri            '\(https\?://\|ftp://\|[rs]sh://\|debtorrent://\|\(cdrom\|copy\|file\):\)[^' 	<>"]\+'
-exe 'syn match debsourcesDistrKeyword   +\([[:alnum:]_./]*\)\<\('. join(s:supported, '\|'). '\)\>\([-[:alnum:]_./]*\)+'
-exe 'syn match debsourcesUnsupportedDistrKeyword +\([[:alnum:]_./]*\)\<\('. join(s:unsupported, '\|') .'\)\>\([-[:alnum:]_./]*\)+'
+syn region debsourcesLine start="^" end="$" contains=debsourcesType,debsourcesFreeComponent,debsourcesNonFreeComponent,debsourcesComment,debsourcesUri,debsourcesDistrKeyword,debsourcesUnsupportedDistrKeyword oneline
+
 
 " Associate our matches and regions with pretty colours
-hi def link debsourcesLine                    Error
 hi def link debsourcesType                    Statement
 hi def link debsourcesFreeComponent           Statement
 hi def link debsourcesNonFreeComponent        Statement
+hi def link debsourcesComment                 Comment
+hi def link debsourcesUri                     Constant
 hi def link debsourcesDistrKeyword            Type
 hi def link debsourcesUnsupportedDistrKeyword WarningMsg
-hi def link debsourcesComment                 Comment
-hi def link debsourcesUri                     Constant
 
 let b:current_syntax = 'debsources'