Skip to content
This repository was archived by the owner on Oct 13, 2021. It is now read-only.

Commit 295b691

Browse files
authored
Merge pull request #156 from nvim-lua/fix_configurable_filetype
feat: add disable filetype
2 parents 5602094 + a77458f commit 295b691

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

lua/completion.lua

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,13 @@ end
246246
M.on_attach = function(option)
247247
-- setup completion_option tables
248248
opt.set_option_table(option)
249+
local disable_filetypes = opt.get_option("disable_filetypes")
250+
local ft = vim.bo.filetype
251+
for _, disable_ft in ipairs(disable_filetypes) do
252+
if ft == disable_ft then
253+
return
254+
end
255+
end
249256
-- setup autocommand
250257
-- TODO: Modified this if lua callbacks for autocmd is merged
251258
api.nvim_command("augroup CompletionCommand")

plugin/completion.vim

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,10 @@ if ! exists('g:completion_matching_smart_case')
9393
let g:completion_matching_smart_case = &smartcase
9494
endif
9595

96+
if ! exists('g:completion_disable_filetypes')
97+
let g:completion_disable_filetypes = []
98+
endif
99+
96100
if ! exists('g:completion_matching_strategy_list')
97101
let g:completion_matching_strategy_list = ['exact']
98102
endif

0 commit comments

Comments
 (0)