set ft=virata
# Strace
- elseif line1 =~ '[0-9:.]* *execve(' || line1 =~ '^__libc_start_main'
+ # inaccurate fast match first, then use accurate slow match
+ elseif (line1 =~ 'execve(' && line1 =~ '^[0-9:.]* *execve(')
+ || line1 =~ '^__libc_start_main'
set ft=strace
# VSE JCL
filetype off
endfunc
+" Content lines that should not result in filetype detection
+let s:false_positive_checks = {
+ \ '': [['test execve("/usr/bin/pstree", ["pstree"], 0x7ff0 /* 63 vars */) = 0']],
+ \ }
+
" Filetypes detected from the file contents by scripts.vim
let s:script_checks = {
\ 'virata': [['% Virata'],
endfunc
func Test_script_detection()
+ call Run_script_detection(s:false_positive_checks)
call Run_script_detection(s:script_checks)
call Run_script_detection(s:script_env_checks)
endfunc