]> granicus.if.org Git - vim/commitdiff
patch 8.2.3603: fish filetype not recognized v8.2.3603
authorBram Moolenaar <Bram@vim.org>
Tue, 16 Nov 2021 15:28:10 +0000 (15:28 +0000)
committerBram Moolenaar <Bram@vim.org>
Tue, 16 Nov 2021 15:28:10 +0000 (15:28 +0000)
Problem:    Fish filetype not recognized.
Solution:   Add a file pattern and match script line. (Doug Kearns)

runtime/filetype.vim
runtime/scripts.vim
src/testdir/test_filetype.vim
src/version.c

index 8fd2fc04a14d67435aa5929c620c12171610a5bc..875823c4829b1cb8ea68f2c46e6c406b3bf15e1e 100644 (file)
@@ -617,6 +617,9 @@ autocmd BufRead,BufNewFile *.fnl            setf fennel
 " Fetchmail RC file
 au BufNewFile,BufRead .fetchmailrc             setf fetchmail
 
+" Fish shell
+au BufNewFile,BufRead *.fish                   setf fish
+
 " FlexWiki - disabled, because it has side effects when a .wiki file
 " is not actually FlexWiki
 "au BufNewFile,BufRead *.wiki                  setf flexwiki
index 79fd0a77e90695ff7000c646fcd97d9ff2aaaa41..0ff8e4908859853ebf56bd01209e3272e0165cb8 100644 (file)
@@ -194,6 +194,10 @@ if s:line1 =~# "^#!"
   elseif s:name =~# 'rsc\>'
     set ft=routeros
 
+    " Fish shell
+  elseif s:name =~# 'fish\>'
+    set ft=fish
+
   endif
   unlet s:name
 
index 90bc159f1e6e98f229eaec586d29148c0e6bbc20..6376334f0fb5441cf8ac31f242ba7ae9a3079580 100644 (file)
@@ -180,6 +180,7 @@ let s:filename_checks = {
     \ 'fennel': ['file.fnl'],
     \ 'fetchmail': ['.fetchmailrc'],
     \ 'fgl': ['file.4gl', 'file.4gh', 'file.m4gl'],
+    \ 'fish': ['file.fish'],
     \ 'focexec': ['file.fex', 'file.focexec'],
     \ 'forth': ['file.fs', 'file.ft', 'file.fth'],
     \ 'fortran': ['file.f', 'file.for', 'file.fortran', 'file.fpp', 'file.ftn', 'file.f77', 'file.f90', 'file.f95', 'file.f03', 'file.f08'],
@@ -662,6 +663,7 @@ let s:script_checks = {
       \ 'pascal': [['#!/path/instantfpc']],
       \ 'fennel': [['#!/path/fennel']],
       \ 'routeros': [['#!/path/rsc']],
+      \ 'fish': [['#!/path/fish']],
       \ }
 
 " Various forms of "env" optional arguments.
index 5d3d2a36aa9d59e23ae42a9e61f0e3edb39c8726..1c8c955b6d765522a1d123e24ce6874689348e5a 100644 (file)
@@ -757,6 +757,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    3603,
 /**/
     3602,
 /**/