patch 9.1.0506: filetype: .envrc & .prettierignore not recognized
Commit:
https://github.com/vim/vim/commit/49012cd8c2fb0452847e5d213b07aa8a978f4762
Author: Tyler Miller <[email protected]>
Date: Thu Jun 20 20:31:32 2024 +0200
patch 9.1.0506: filetype: .envrc & .prettierignore not recognized
Problem: filetype: .envrc & .prettierignore not recognized
Solution: Detect '.envrc' as shell and '.prettierignore' as gitignore
filetype (Tyler Miller)
Support ft detection for `.envrc` files used by direnv, and
`.prettierignore` files used by prettier.
closes: #15053
resolves: neovim/neovim#29405
Signed-off-by: Tyler Miller <[email protected]>
Signed-off-by: Christian Brabandt <[email protected]>
diff --git a/runtime/filetype.vim b/runtime/filetype.vim
index 54bce30e2..6cb2de1d6 100644
--- a/runtime/filetype.vim
+++ b/runtime/filetype.vim
@@ -887,7 +887,7 @@ au BufNewFile,BufRead .gitattributes,*.git/info/attributes
setf gitattributes
au BufNewFile,BufRead */.config/git/attributes setf
gitattributes
au BufNewFile,BufRead */etc/gitattributes setf
gitattributes
au BufNewFile,BufRead .gitignore,*.git/info/exclude setf gitignore
-au BufNewFile,BufRead */.config/git/ignore setf gitignore
+au BufNewFile,BufRead */.config/git/ignore,*.prettierignore setf gitignore
au BufNewFile,BufRead git-rebase-todo setf gitrebase
au BufRead,BufNewFile .gitsendemail.msg.?????? setf
gitsendemail
au BufNewFile,BufRead *.git/*
@@ -2156,7 +2156,7 @@ au BufNewFile,BufRead catalog setf
catalog
" NOTE: Patterns ending in a star are further down, these have lower priority.
au BufNewFile,BufRead
.bashrc,bashrc,bash.bashrc,.bash[_-]profile,.bash[_-]logout,.bash[_-]aliases,.bash[_-]history,bash-fc[-.],*.ebuild,*.bash,*.eclass,PKGBUILD,APKBUILD,*.bats,*.cygport
call dist#ft#SetFileTypeSH("bash")
au BufNewFile,BufRead .kshrc,*.ksh call dist#ft#SetFileTypeSH("ksh")
-au BufNewFile,BufRead */etc/profile,.profile,*.sh,*.env call
dist#ft#SetFileTypeSH(getline(1))
+au BufNewFile,BufRead */etc/profile,.profile,*.sh,*.env{rc,} call
dist#ft#SetFileTypeSH(getline(1))
" Shell script (Arch Linux) or PHP file (Drupal)
au BufNewFile,BufRead *.install
diff --git a/src/testdir/test_filetype.vim b/src/testdir/test_filetype.vim
index 5aec6fba2..2dd317e63 100644
--- a/src/testdir/test_filetype.vim
+++ b/src/testdir/test_filetype.vim
@@ -286,7 +286,7 @@ def s:GetFilenameChecks(): dict<list<string>>
gitattributes: ['file.git/info/attributes', '.gitattributes',
'/.config/git/attributes', '/etc/gitattributes',
'/usr/local/etc/gitattributes', 'some.git/info/attributes'] +
WhenConfigHome('$XDG_CONFIG_HOME/git/attributes'),
gitcommit: ['COMMIT_EDITMSG', 'MERGE_MSG', 'TAG_EDITMSG', 'NOTES_EDITMSG',
'EDIT_DESCRIPTION'],
gitconfig: ['file.git/config', 'file.git/config.worktree',
'file.git/worktrees/x/config.worktree', '.gitconfig', '.gitmodules',
'file.git/modules//config', '/.config/git/config', '/etc/gitconfig',
'/usr/local/etc/gitconfig', '/etc/gitconfig.d/file',
'any/etc/gitconfig.d/file', '/.gitconfig.d/file', 'any/.config/git/config',
'any/.gitconfig.d/file', 'some.git/config', 'some.git/modules/any/config'] +
WhenConfigHome('$XDG_CONFIG_HOME/git/config'),
- gitignore: ['file.git/info/exclude', '.gitignore', '/.config/git/ignore',
'some.git/info/exclude'] + WhenConfigHome('$XDG_CONFIG_HOME/git/ignore'),
+ gitignore: ['file.git/info/exclude', '.gitignore', '/.config/git/ignore',
'some.git/info/exclude'] + WhenConfigHome('$XDG_CONFIG_HOME/git/ignore') +
['.prettierignore'],
gitolite: ['gitolite.conf', '/gitolite-admin/conf/file',
'any/gitolite-admin/conf/file'],
gitrebase: ['git-rebase-todo'],
gitsendemail: ['.gitsendemail.msg.xxxxxx'],
@@ -646,7 +646,7 @@ def s:GetFilenameChecks(): dict<list<string>>
sh: ['.bashrc', '.bash_profile', '.bash-profile', '.bash_logout',
'.bash-logout', '.bash_aliases', '.bash-aliases', '.bash_history',
'.bash-history',
'/tmp/bash-fc-3Ozjlw', '/tmp/bash-fc.3Ozjlw', 'PKGBUILD', 'APKBUILD',
'file.bash', '/usr/share/doc/bash-completion/filter.sh',
'/etc/udev/cdsymlinks.conf', 'any/etc/udev/cdsymlinks.conf',
'file.bats', '.ash_history', 'any/etc/neofetch/config.conf', '.xprofile',
- 'user-dirs.defaults', 'user-dirs.dirs', 'makepkg.conf',
'.makepkg.conf', 'file.mdd', 'file.cygport'],
+ 'user-dirs.defaults', 'user-dirs.dirs', 'makepkg.conf',
'.makepkg.conf', 'file.mdd', 'file.cygport', '.env', '.envrc'],
sieve: ['file.siv', 'file.sieve'],
sil: ['file.sil'],
simula: ['file.sim'],
diff --git a/src/version.c b/src/version.c
index 44d021475..9d40d8fde 100644
--- a/src/version.c
+++ b/src/version.c
@@ -704,6 +704,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 506,
/**/
505,
/**/
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/E1sKMmS-007NPf-Rc%40256bit.org.