summaryrefslogtreecommitdiffstats
path: root/runtime
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-01-05 20:56:38 +0000
committerBram Moolenaar <Bram@vim.org>2022-01-05 20:56:38 +0000
commitc689f8c3d98fffe7e13730e198ce120934528f9c (patch)
tree40a8e9be0d9b4db636f7e06bd6a0ae7ac8d7fbdf /runtime
parente60b3c47d701e73ecbadb1b9a12bf82010cadae8 (diff)
patch 8.2.4014: git and gitcommit file types not properly recognizedv8.2.4014
Problem: Git and gitcommit file types not properly recognized. Solution: Adjust filetype detection. (Tim Pope, closes #9477)
Diffstat (limited to 'runtime')
-rw-r--r--runtime/filetype.vim9
-rw-r--r--runtime/scripts.vim2
2 files changed, 4 insertions, 7 deletions
diff --git a/runtime/filetype.vim b/runtime/filetype.vim
index c92ae69e1d..f6ba012f37 100644
--- a/runtime/filetype.vim
+++ b/runtime/filetype.vim
@@ -497,7 +497,7 @@ au BufNewFile,BufRead */debian/patches/* call dist#ft#Dep3patch()
" Diff files
au BufNewFile,BufRead *.diff,*.rej setf diff
au BufNewFile,BufRead *.patch
- \ if getline(1) =~ '^From [0-9a-f]\{40\} Mon Sep 17 00:00:00 2001$' |
+ \ if getline(1) =~# '^From [0-9a-f]\{40,\} Mon Sep 17 00:00:00 2001$' |
\ setf gitsendemail |
\ else |
\ setf diff |
@@ -676,6 +676,7 @@ autocmd BufRead,BufNewFile *.gift setf gift
" Git
au BufNewFile,BufRead COMMIT_EDITMSG,MERGE_MSG,TAG_EDITMSG setf gitcommit
+au BufNewFile,BufRead NOTES_EDITMSG,EDIT_DESCRIPTION setf gitcommit
au BufNewFile,BufRead *.git/config,.gitconfig,/etc/gitconfig setf gitconfig
au BufNewFile,BufRead */.config/git/config setf gitconfig
au BufNewFile,BufRead .gitmodules,*.git/modules/*/config setf gitconfig
@@ -684,12 +685,8 @@ if !empty($XDG_CONFIG_HOME)
endif
au BufNewFile,BufRead git-rebase-todo setf gitrebase
au BufRead,BufNewFile .gitsendemail.msg.?????? setf gitsendemail
-au BufNewFile,BufRead .msg.[0-9]*
- \ if getline(1) =~ '^From.*# This line is ignored.$' |
- \ setf gitsendemail |
- \ endif
au BufNewFile,BufRead *.git/*
- \ if getline(1) =~ '^\x\{40\}\>\|^ref: ' |
+ \ if getline(1) =~# '^\x\{40,\}\>\|^ref: ' |
\ setf git |
\ endif
diff --git a/runtime/scripts.vim b/runtime/scripts.vim
index 3790b1c10f..e41405a6c5 100644
--- a/runtime/scripts.vim
+++ b/runtime/scripts.vim
@@ -384,7 +384,7 @@ else
set ft=scheme
" Git output
- elseif s:line1 =~# '^\(commit\|tree\|object\) \x\{40\}\>\|^tag \S\+$'
+ elseif s:line1 =~# '^\(commit\|tree\|object\) \x\{40,\}\>\|^tag \S\+$'
set ft=git
" Gprof (gnu profiler)