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:
parent
5c381eb9e7
commit
6a7af8e2db
@ -212,6 +212,11 @@ else
|
|||||||
elseif s:line1 =~# '^" *[vV]im$'
|
elseif s:line1 =~# '^" *[vV]im$'
|
||||||
set ft=vim
|
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
|
" MOO
|
||||||
elseif s:line1 =~# '^\*\* LambdaMOO Database, Format Version \%([1-3]\>\)\@!\d\+ \*\*$'
|
elseif s:line1 =~# '^\*\* LambdaMOO Database, Format Version \%([1-3]\>\)\@!\d\+ \*\*$'
|
||||||
set ft=moo
|
set ft=moo
|
||||||
|
@ -586,6 +586,8 @@ let s:script_checks = {
|
|||||||
\ 'cfengine': [['#!/path/cfengine']],
|
\ 'cfengine': [['#!/path/cfengine']],
|
||||||
\ 'erlang': [['#!/path/escript']],
|
\ 'erlang': [['#!/path/escript']],
|
||||||
\ 'haskell': [['#!/path/haskell']],
|
\ 'haskell': [['#!/path/haskell']],
|
||||||
|
\ 'cpp': [['// Standard iostream objects -*- C++ -*-'],
|
||||||
|
\ ['// -*- C++ -*-']],
|
||||||
\ }
|
\ }
|
||||||
|
|
||||||
func Test_script_detection()
|
func Test_script_detection()
|
||||||
|
@ -777,6 +777,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
1593,
|
||||||
/**/
|
/**/
|
||||||
1592,
|
1592,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user