summaryrefslogtreecommitdiffstats
path: root/runtime/autoload/dist/ft.vim
diff options
context:
space:
mode:
authorJames McCoy <jamessan@jamessan.com>2021-12-17 20:52:57 +0000
committerBram Moolenaar <Bram@vim.org>2021-12-17 20:52:57 +0000
commit647ab4cede4dbf412d24748f8e0a64d1cb9239f4 (patch)
tree0c2968d46f26a02dbf2f8aaba7c50cea26b1f614 /runtime/autoload/dist/ft.vim
parent422085f1c87cb6bea879158b8b05c4a5cf7ab48b (diff)
patch 8.2.3843: dep3patch files are not recognizedv8.2.3843
Problem: Dep3patch files are not recognized. Solution: Recognize dep3patch files by their location and content. (James McCoy, closes #9367)
Diffstat (limited to 'runtime/autoload/dist/ft.vim')
-rw-r--r--runtime/autoload/dist/ft.vim17
1 files changed, 17 insertions, 0 deletions
diff --git a/runtime/autoload/dist/ft.vim b/runtime/autoload/dist/ft.vim
index a3db4ae87a..366d7b009d 100644
--- a/runtime/autoload/dist/ft.vim
+++ b/runtime/autoload/dist/ft.vim
@@ -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