mirror of
https://github.com/neovim/neovim.git
synced 2025-10-08 19:06:31 +00:00
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 vim/vim#4593)
6a7af8e2db
This commit is contained in:
@@ -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
|
||||||
|
@@ -581,6 +581,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()
|
||||||
|
Reference in New Issue
Block a user