Skip to content
This repository has been archived by the owner on May 6, 2024. It is now read-only.

Setting filetype via function_complex has no effect #44

Closed
ghillb opened this issue Nov 12, 2021 · 0 comments · Fixed by #45
Closed

Setting filetype via function_complex has no effect #44

ghillb opened this issue Nov 12, 2021 · 0 comments · Fixed by #45

Comments

@ghillb
Copy link

ghillb commented Nov 12, 2021

Hi! After reading the Readme I thought the following two configs should essentially do the same. But they don't.

This sets the filetype to gitlab-ci, when opening .gitlab-ci.yml:

vim.g.did_load_filetypes = 1
require('filetype').setup({
  overrides = {
    extensions = {
    },
    literal = {
    },
    complex = {
      [".*gitlab.*yml"] = "gitlab-ci",
    },
  }
})

This does not:

vim.g.did_load_filetypes = 1
require('filetype').setup({
  overrides = {
    function_extensions = {
    },
    function_literal = {
    },
    function_complex = {
      [".*gitlab.*yml"] = function()
        vim.bo.filetype = 'gitlab-ci'
      end
    },
  }
})

I'm using nvim 5.1.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant