Skip to content

Commit

Permalink
patch 9.1.0610: filetype: OpenGL Shading Language files are not detected
Browse files Browse the repository at this point in the history
Problem:  filetype: OpenGL Shading Language files are not detected
Solution: detect various file extensions as GLSL filetype, include
          indent and syntax script, do no longer recognize '*.comp'
          as Mason filetype (Gregory Anders)

closes: #15317

Signed-off-by: Gregory Anders <greg@gpanders.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
  • Loading branch information
gpanders authored and chrisbra committed Jul 22, 2024
1 parent 9d57ea5 commit e4b991e
Show file tree
Hide file tree
Showing 6 changed files with 777 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .github/MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,7 @@ runtime/indent/freebasic.vim @dkearns
runtime/indent/gdscript.vim @habamax
runtime/indent/gitconfig.vim @tpope
runtime/indent/gitolite.vim @sitaramc
runtime/indent/glsl.vim @gpanders
runtime/indent/go.vim @dbarnett
runtime/indent/gyp.vim @ObserverOfTime
runtime/indent/haml.vim @tpope
Expand Down Expand Up @@ -439,6 +440,7 @@ runtime/syntax/gitconfig.vim @tpope
runtime/syntax/gitignore.vim @ObserverOfTime
runtime/syntax/gitolite.vim @sitaramc
runtime/syntax/gitrebase.vim @tpope
runtime/syntax/glsl.vim @gpanders
runtime/syntax/go.vim @bhcleek
runtime/syntax/godoc.vim @dbarnett
runtime/syntax/gp.vim @KBelabas
Expand Down
8 changes: 5 additions & 3 deletions runtime/filetype.vim
Original file line number Diff line number Diff line change
Expand Up @@ -915,7 +915,9 @@ au BufNewFile,BufRead gkrellmrc,gkrellmrc_? setf gkrellmrc
au BufNewFile,BufRead *.gleam setf gleam

" GLSL
au BufNewFile,BufRead *.glsl setf glsl
" Extensions supported by Khronos reference compiler (with one exception, ".glsl")
" https://github.com/KhronosGroup/glslang
au BufNewFile,BufRead *.vert,*.tesc,*.tese,*.glsl,*.geom,*.frag,*.comp,*.rgen,*.rmiss,*.rchit,*.rahit,*.rint,*.rcall setf glsl

" GN (generate ninja) files
au BufNewFile,BufRead *.gn,*.gni setf gn
Expand Down Expand Up @@ -1414,8 +1416,8 @@ au BufNewFile,BufRead *.markdown,*.mdown,*.mkd,*.mkdn,*.mdwn,*.md
\ setf markdown |
\ endif

" Mason
au BufNewFile,BufRead *.mason,*.mhtml,*.comp setf mason
" Mason (it used to include *.comp, are those Mason files?)
au BufNewFile,BufRead *.mason,*.mhtml setf mason

" Mathematica, Matlab, Murphi, Objective C or Octave
au BufNewFile,BufRead *.m call dist#ft#FTm()
Expand Down
14 changes: 14 additions & 0 deletions runtime/indent/glsl.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
" Language: OpenGL Shading Language
" Maintainer: Gregory Anders <greg@gpanders.com>
" Last Modified: 2024 Jul 21
" Upstream: https://github.com/tikhomirov/vim-glsl

if exists('b:did_indent')
finish
endif
let b:did_indent = 1

setlocal autoindent cindent
setlocal cinoptions&

let b:undo_indent = 'setl ai< ci< cino<'
Loading

0 comments on commit e4b991e

Please sign in to comment.