Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions lua/nvim-rooter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ local _config = {
['dashboard'] = true,
['TelescopePrompt'] = true,
},
exclude_buftypes = {
['terminal'] = true,
['prompt'] = true,
['quickfix'] = true,
},
fallback_to_parent = false,
}

Expand Down Expand Up @@ -42,6 +47,10 @@ local function activate()
return false
end

if _config.exclude_buftypes[vim.bo.buftype] ~= nil then
return false
end

local filename = vim.api.nvim_buf_get_name(0)
for _, pattern in ipairs(_config.trigger_patterns) do
-- https://riptutorial.com/lua/topic/5829/pattern-matching
Expand Down Expand Up @@ -163,6 +172,7 @@ local function setup(opts)
or { '.git', '.hg', '.svn' }
_config.trigger_patterns = opts.trigger_patterns ~= nil and opts.trigger_patterns or { '*' }
_config.exclude_filetypes = merge(_config.exclude_filetypes, opts.exclude_filetypes)
_config.exclude_buftypes = merge(_config.exclude_buftypes, opts.exclude_buftypes)
_config.fallback_to_parent = opts.fallback_to_parent ~= nil and opts.fallback_to_parent
_config.cd_scope = opts.cd_scope ~= nil and opts.cd_scope or "global"

Expand Down