In the current master version, Vim incorrectly identifies scientific parameter files (specifically those using Fortran-style comments and scientific notation) as BitBake recipes.
Because BitBake syntax looks very strict, it flags common scientific data structures and comment characters (!) as errors, resulting in the entire buffer being highlighted with a red background.
The issue stems from the internal function dist#ft#FTinc() located in /usr/share/vim/vim92/filetype.vim
Running :verbose set filetype? confirms the filetype is set to bitbake by the system filetype.vim.
Previous to commit 9fd1a65 vim defaults to less intrusive highlighters like filetype=pov when the language is ambiguous, avoiding the "all-red" error state.
Reproducer:
!Prandtl number Pr = nu/kappa Pr 1.0d0 !Rayleigh number Ra = (alpha g Delta H^3)/(kappa nu) Ra 1.0d8 ! "explicit_eu" | "implicit_eu" | "implicit_cn" !velo_scheme "explicit_eu" !temp_scheme "explicit_eu" !***************** Specifications ******************* restart .true. !restart .false. !statistics .false. statistics .true. !radius is reference length, i.e. it must be 1 radius 1.0d0 !height height 4.0d0 !number of nodes in each direction dim_z 360 dim_r 128 dim_phi 384 !geometry: mesh details !Select mesh type. tanhr = .true. for tanh and .false. for Chebysheb type tanhr .false. tanhz .false. !Stretching parameters (integer) for Chebysheb mesh rclip 9 zclip 8 !parameters for mesh generation r_beg 2.0d-2 r_end 1.0d-2 z_beg 1.0d-2 ! wall clock time limit (in seconds) ! 24h = 86400s ! 32h = 115200s ! 48h = 172800s wct_limit 86100.0d0 time_limit 9800.d0
master or vim >= 9.1.1732
Operating systems: Gentoo (any other linux works)
Terminal: Alacritty
Value of $TERM: xterm-256colors
Shell: zsh
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.![]()
A quick workaround I came up with is
diff --git a/runtime/autoload/dist/ft.vim b/runtime/autoload/dist/ft.vim index 6cfcd350d777..ca0b7dc8639a 100644 --- a/runtime/autoload/dist/ft.vim +++ b/runtime/autoload/dist/ft.vim @@ -873,7 +873,8 @@ export def FTinc() elseif line =~ '^\s*\%({\|(\*\)' || line =~? ft_pascal_keywords setf pascal return - elseif line =~# '\<\%(require\|inherit\)\>' || line =~# '[A-Z][A-Za-z0-9_:${}/]*\s\+\%(??\|[?:+.]\)\?=.\? ' + elseif line =~# '^\s*\%(require\|inherit\)\>' + || line =~# "^\s*[A-Z][A-Za-z0-9_:${}/-]*\s*\\%(??=\\|:=\\|+=\\|?=\\|\\.=\\|=\\.\\|=\\)\\s*\\%(['\"]\\|\\${\\)" setf bitbake return endif
Not sure if it's correct or proper but now not everything in the .inc files is red
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.![]()