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

default auto_resize_height quickfix height of 10 seems too high #58

Closed
mccurdyc opened this issue Mar 2, 2022 · 8 comments
Closed

default auto_resize_height quickfix height of 10 seems too high #58

mccurdyc opened this issue Mar 2, 2022 · 8 comments
Labels
bug Something isn't working

Comments

@mccurdyc
Copy link

mccurdyc commented Mar 2, 2022

Feature description

I love bqf! Thank you for your work on it!

The default auto_resize_height quickfix height of 10 seems too high, could we make it the size of the list or 1 instead of 10?

Describe the solution you'd like

Quickfix has a default height of the number of items in the quickfix list even when <10 items or if the quickfix is empty, maybe quickfix height is 1.

Additional context

to size of list or to default height (10)]],

@mccurdyc mccurdyc added the enhancement New feature or request label Mar 2, 2022
@kevinhwang91
Copy link
Owner

I guess you misunderstand the description of auto_resize_height.
Assume we have enabled auto_resize_height.

  1. List size is 100, cw 15 will set the height to 15;
  2. List size is 5, cw 15 will set the height to 5;
  3. List size is 0, copen 15 will set the height to 1, because 0 height is not permitted
  4. Current list size is 1, previous list size is 15, cold will set the height to 10;
  5. Current list size is 15, previous list size is 1, cold will set the height to 1;

:h :copen

When [height] is given, the window becomes that high
(if there is room). When [height] is omitted the
window is made ten lines high.

@mccurdyc
Copy link
Author

mccurdyc commented Mar 4, 2022

@kevinhwang91 thanks!! Unfortunately, I think I still misunderstand.

I have auto_resize_height set to true and my quickfix list has 2 items, yet my quickfix window is still a height of 10.

I expect it to automatically resize to 2.

How can I ensure that my quickfix is using bqf instead of the normal quickfix window? I've tried :BqfEnable in the quickfix window and then re-saved (still no resizing) and I have auto_enable = true in my bqf configuration. Is there anything else I can do?

Thanks!

@kevinhwang91
Copy link
Owner

Check out your others plugins that may conflict. try minimal config.

@kevinhwang91 kevinhwang91 removed the enhancement New feature or request label Mar 5, 2022
@mccurdyc
Copy link
Author

mccurdyc commented Mar 5, 2022

If this is just me, I'll close.

@mccurdyc mccurdyc closed this as completed Mar 5, 2022
@mccurdyc
Copy link
Author

mccurdyc commented Mar 6, 2022

Confirmed worked as expected with this minimal config and by running this command vimgrep /bqf/j % | copen

https://github.com/mccurdyc/dotfiles/blob/6f350ec2ac4f3923ff2cee61f24a8bc3ef065365/minimal/init.lua

local cmd = vim.cmd
local o, wo, bo = vim.o, vim.wo, vim.bo

local function opt(o, v, scopes)
  scopes = scopes or {o_s}
  for _, s in ipairs(scopes) do s[o] = v end
end

local buffer = {o, bo}
local window = {o, wo}

cmd("filetype plugin indent on")

opt("clipboard", "unnamedplus")
opt("swapfile", false, buffer)
opt("title", true)
opt("wrap", false, window)
opt("number", true, window)
opt("linebreak", true, window)
opt("showbreak", "━━")
opt("breakindent", true, window)
opt("tabstop", 2, buffer)
opt("shiftwidth", 2)
opt("expandtab", true, buffer)
opt("shiftround", true)
opt("lazyredraw", true)
opt("colorcolumn", "80", window)
opt("hidden", true)
opt("list", true)
opt("syntax", "enable")
opt("hlsearch", false)
opt("splitbelow", true)
opt("splitright", true)
opt("showmode", false)
opt("foldminlines", 5)
opt("foldmethod", "indent")

require("packer").startup(
  {
    function()
      -- https://github.com/wbthomason/packer.nvim/blob/daec6c759f95cd8528e5dd7c214b18b4cec2658c/doc/packer.txt#L534
      use "wbthomason/packer.nvim"

      use {'kevinhwang91/nvim-bqf'}
    end
  }
)
require('bqf').setup({
        auto_enable = true,
        auto_resize_height = true,
})

@mccurdyc
Copy link
Author

mccurdyc commented Mar 6, 2022

Actually, with these bqf settings, the same test as above presents the unexpected behavior. So I believe there is an issue with these combination of settings.

mccurdyc/dotfiles@6a9ccb8

local cmd = vim.cmd
local o, wo, bo = vim.o, vim.wo, vim.bo

local function opt(o, v, scopes)
  scopes = scopes or {o_s}
  for _, s in ipairs(scopes) do s[o] = v end
end

local buffer = {o, bo}
local window = {o, wo}

cmd("filetype plugin indent on")

opt("clipboard", "unnamedplus")
opt("swapfile", false, buffer)
opt("title", true)
opt("wrap", false, window)
opt("number", true, window)
opt("linebreak", true, window)
opt("showbreak", "━━")
opt("breakindent", true, window)
opt("tabstop", 2, buffer)
opt("shiftwidth", 2)
opt("expandtab", true, buffer)
opt("shiftround", true)
opt("lazyredraw", true)
opt("colorcolumn", "80", window)
opt("hidden", true)
opt("list", true)
opt("syntax", "enable")
opt("hlsearch", false)
opt("splitbelow", true)
opt("splitright", true)
opt("showmode", false)
opt("foldminlines", 5)
opt("foldmethod", "indent")

require("packer").startup(
  {
    function()
      -- https://github.com/wbthomason/packer.nvim/blob/daec6c759f95cd8528e5dd7c214b18b4cec2658c/doc/packer.txt#L534
      use "wbthomason/packer.nvim"

      use {
        "kevinhwang91/nvim-bqf"
      }
    end
  }
)

require("bqf").setup({
  auto_enable = true,
  magic_window = false,
  auto_resize_height = true,
})

@mccurdyc mccurdyc reopened this Mar 6, 2022
@mccurdyc
Copy link
Author

mccurdyc commented Mar 6, 2022

As soon as I remove magic_window = false, I get the behavior I expect.

@kevinhwang91
Copy link
Owner

Thanks, fixed now.

@kevinhwang91 kevinhwang91 added the bug Something isn't working label Mar 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants