aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/lua')
-rw-r--r--runtime/lua/vim/filetype/detect.lua11
1 files changed, 9 insertions, 2 deletions
diff --git a/runtime/lua/vim/filetype/detect.lua b/runtime/lua/vim/filetype/detect.lua
index d1eabadc4a..94114ae7c3 100644
--- a/runtime/lua/vim/filetype/detect.lua
+++ b/runtime/lua/vim/filetype/detect.lua
@@ -1550,8 +1550,15 @@ local patterns_text = {
['^SNNS pattern definition file'] = 'snnspat',
['^SNNS result file'] = 'snnsres',
['^%%.-[Vv]irata'] = { 'virata', { start_lnum = 1, end_lnum = 5 } },
- ['[0-9:%.]* *execve%('] = 'strace',
- ['^__libc_start_main'] = 'strace',
+ function(lines)
+ if
+ -- inaccurate fast match first, then use accurate slow match
+ (lines[1]:find('execve%(') and lines[1]:find('^[0-9:%.]* *execve%('))
+ or lines[1]:find('^__libc_start_main')
+ then
+ return 'strace'
+ end
+ end,
-- VSE JCL
['^\\* $$ JOB\\>'] = { 'vsejcl', { vim_regex = true } },
['^// *JOB\\>'] = { 'vsejcl', { vim_regex = true } },