1
0
forked from aniani/vim

patch 8.1.1593: filetype not detected for C++ header files without extension

Problem:    Filetype not detected for C++ header files without extension.
Solution:   Recognize the file by the Emacs file mode. (Dmitry Ilyin,
            closes #4593)
This commit is contained in:
Bram Moolenaar 2019-06-25 21:34:26 +02:00
parent 5c381eb9e7
commit 6a7af8e2db
3 changed files with 13 additions and 4 deletions

View File

@ -212,6 +212,11 @@ else
elseif s:line1 =~# '^" *[vV]im$'
set ft=vim
" libcxx and libstdc++ standard library headers like "iostream" do not have
" an extension, recognize the Emacs file mode.
elseif s:line1 =~? '-\*-.*C++.*-\*-'
set ft=cpp
" MOO
elseif s:line1 =~# '^\*\* LambdaMOO Database, Format Version \%([1-3]\>\)\@!\d\+ \*\*$'
set ft=moo

View File

@ -586,6 +586,8 @@ let s:script_checks = {
\ 'cfengine': [['#!/path/cfengine']],
\ 'erlang': [['#!/path/escript']],
\ 'haskell': [['#!/path/haskell']],
\ 'cpp': [['// Standard iostream objects -*- C++ -*-'],
\ ['// -*- C++ -*-']],
\ }
func Test_script_detection()

View File

@ -777,6 +777,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1593,
/**/
1592,
/**/