vim-polyglot icon indicating copy to clipboard operation
vim-polyglot copied to clipboard

filetype_m doesn't take precedence

Open edgarcosta opened this issue 3 years ago • 0 comments

Describe the bug:

the block in autoload/polyglot/detect.vim

  if exists("g:filetype_m")
    let &ft = g:filetype_m | return
  endif

is at the end of polyglot#detect#M instead of being at the beginning.

To Reproduce:

  • let g:filetype_m = 'foobar'
  • open octave/objc/matlab/mma/murphi look like filename that ends in .m
  • see that filetype is not set to foobar

To Fix:

Run makefile? (I tried but it fails on my machine)

In the last commit to autoload/polyglot/ft.vim the block was already moved to the top.

func polyglot#ft#FTm()
  if exists("g:filetype_m")
    exe "setf " . g:filetype_m
    return
  endif

edgarcosta avatar Nov 13 '21 11:11 edgarcosta