summaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
author=?UTF-8?q?Teubel=20Gy=C3=B6rgy?= <tgyurci@gmail.com>2022-02-24 17:59:09 +0000
committerBram Moolenaar <Bram@vim.org>2022-02-24 17:59:09 +0000
commit4d56b971cbae01cc454eb09713326224993e38ed (patch)
treee8ad0386cf93d936903fe72b0e0443a7c79d9b5f /runtime
parent38b85cb4d7216705058708bacbc25ab90cd61595 (diff)
downloadvim-git-4d56b971cbae01cc454eb09713326224993e38ed.tar.gz
patch 8.2.4464: Dtrace files are recognized as filetype Dv8.2.4464
Problem: Dtrace files are recognized as filetype D. Solution: Add a pattern for Dtrace files. (Teubel György, closes #9841) Add some more testing.
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