feat: allow excluding filetypes from selector autolaunch. (#1937)
Co-authored-by: doodleEsc <cokie@foxmail.com> Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
This commit is contained in:
@@ -1548,6 +1548,10 @@ function Sidebar:initialize()
|
||||
|
||||
if not self.code.bufnr or not api.nvim_buf_is_valid(self.code.bufnr) then return self end
|
||||
|
||||
-- check if the filetype of self.code.bufnr is disabled
|
||||
local buf_ft = api.nvim_get_option_value("filetype", { buf = self.code.bufnr })
|
||||
if vim.list_contains(Config.selector.exclude_auto_select, buf_ft) then return self end
|
||||
|
||||
local buf_path = api.nvim_buf_get_name(self.code.bufnr)
|
||||
-- if the filepath is outside of the current working directory then we want the absolute path
|
||||
local filepath = Utils.file.is_in_cwd(buf_path) and Utils.relative_path(buf_path) or buf_path
|
||||
|
||||
Reference in New Issue
Block a user