Skip to content

Commit

Permalink
ft check
Browse files Browse the repository at this point in the history
  • Loading branch information
clpi committed Jan 12, 2025
1 parent 835fd65 commit fb8ad36
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lua/down/mod/lsp/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,7 @@ Lsp.info = {
}

function Lsp.run()
local ext = vim.fn.expand '%:e'
if ext == 'md' or ext == 'dn' or ext == 'dd' or ext == 'down' or ext == 'downrc' then
if Lsp.is_md() then
lsp.start(Lsp.info)
end
end
Expand Down Expand Up @@ -167,6 +166,10 @@ Lsp.autocmd = function(fty)
})
end

Lsp.is_md = function()
local ext = vim.fn.expand '%:e'
return ext == 'md' or ext == 'dn' or ext == 'dd' or ext == 'down' or ext == 'downrc'
end
Lsp.ft = function(fty)
return vim.api.nvim_create_autocmd({ 'FileType' }, {
pattern = fty or '*',
Expand Down

0 comments on commit fb8ad36

Please sign in to comment.