summaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
Diffstat (limited to 'runtime')
-rw-r--r--runtime/autoload/dist/ft.vim4
-rw-r--r--runtime/filetype.vim1
2 files changed, 5 insertions, 0 deletions
diff --git a/runtime/autoload/dist/ft.vim b/runtime/autoload/dist/ft.vim
index 4f5b88a7f..9f9fef042 100644
--- a/runtime/autoload/dist/ft.vim
+++ b/runtime/autoload/dist/ft.vim
@@ -206,6 +206,10 @@ export def EuphoriaCheck()
enddef
export def DtraceCheck()
+ if did_filetype()
+ # Filetype was already detected
+ return
+ endif
var lines = getline(1, min([line("$"), 100]))
if match(lines, '^module\>\|^import\>') > -1
# D files often start with a module and/or import statement.
diff --git a/runtime/filetype.vim b/runtime/filetype.vim
index 3b7f92dff..77c736c18 100644
--- a/runtime/filetype.vim
+++ b/runtime/filetype.vim
@@ -484,6 +484,7 @@ au BufNewFile,BufRead */etc/dnsmasq.conf setf dnsmasq
au BufNewFile,BufRead *.desc setf desc
" the D language or dtrace
+au BufNewFile,BufRead */dtrace/*.d setf dtrace
au BufNewFile,BufRead *.d call dist#ft#DtraceCheck()
" Desktop files