Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(config): add option to disable auto_close #125

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,10 @@ Using external grep-like program to search `display` and replace it to `show`, b
description = [[Enable nvim-bqf in quickfix window automatically]],
default = true
},
auto_close = {
description = [[Automatically close nvim-bqf if it is the only window, replacing it with an empty buffer]]
default = true
}
magic_window = {
description = [[Give the window magic, when the window is splited horizontally, keep
the distance between the current line and the top/bottom border of neovim unchanged.
Expand Down
1 change: 1 addition & 0 deletions lua/bqf/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
---@field filter BqfConfigFilter
local def = {
auto_enable = true,
auto_close = true,
magic_window = true,
auto_resize_height = false,
previous_winid_ft_skip = {},
Expand Down
2 changes: 1 addition & 1 deletion lua/bqf/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ function M.enable()
cmd([[
aug Bqf
au! * <buffer>
au WinEnter <buffer> ++nested lua require('bqf.main').killAloneQf()
au WinEnter <buffer> ++nested lua if require('bqf.config').auto_close then require('bqf.main').killAloneQf() end
au WinClosed <buffer> ++nested lua require('bqf.main').closeQf()
au WinLeave <buffer> lua require('bqf.main').saveWinView()
aug END
Expand Down