mirror of
https://github.com/neovim/neovim.git
synced 2025-09-30 15:08:35 +00:00
vim-patch:9.0.1464: strace filetype detection is expensive
Problem: Strace filetype detection is expensive. Solution: Match with a cheap pattern first. (Federico Mengozzi, closes vim/vim#12220)6e5a9f9482
Co-authored-by: Federico Mengozzi <19249682+fedemengo@users.noreply.github.com> (cherry picked from commit9808866d57
)
This commit is contained in:

committed by
github-actions[bot]
![github-actions[bot]](/assets/img/avatar_default.png)
parent
4d30f34a37
commit
17bdaeb79e
@@ -734,6 +734,11 @@ func Test_filetype_detection()
|
||||
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'],
|
||||
@@ -826,6 +831,7 @@ func Run_script_detection(test_dict)
|
||||
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
|
||||
|
Reference in New Issue
Block a user