patch 8.2.3843: dep3patch files are not recognized
Problem: Dep3patch files are not recognized.
Solution: Recognize dep3patch files by their location and content. (James
McCoy, closes #9367)
This commit is contained in:
committed by
Bram Moolenaar
parent
422085f1c8
commit
647ab4cede
17
runtime/autoload/dist/ft.vim
vendored
17
runtime/autoload/dist/ft.vim
vendored
@ -811,6 +811,23 @@ func dist#ft#Redif()
|
||||
endwhile
|
||||
endfunc
|
||||
|
||||
" This function is called for all files under */debian/patches/*, make sure not
|
||||
" to non-dep3patch files, such as README and other text files.
|
||||
func dist#ft#Dep3patch()
|
||||
if expand('%:t') ==# 'series'
|
||||
return
|
||||
endif
|
||||
|
||||
for ln in getline(1, 100)
|
||||
if ln =~# '^\%(Description\|Subject\|Origin\|Bug\|Forwarded\|Author\|From\|Reviewed-by\|Acked-by\|Last-Updated\|Applied-Upstream\):'
|
||||
setf dep3patch
|
||||
return
|
||||
elseif ln =~# '^---'
|
||||
" end of headers found. stop processing
|
||||
return
|
||||
endif
|
||||
endfor
|
||||
endfunc
|
||||
|
||||
" Restore 'cpoptions'
|
||||
let &cpo = s:cpo_save
|
||||
|
||||
Reference in New Issue
Block a user