echasnovski / mini.nvim

Library of 40+ independent Lua modules improving overall Neovim (version 0.8 and higher) experience with minimal effort
MIT License
4.84k stars 183 forks source link

Mini.pick can't handle custom window border #608

Closed Diablo-D3 closed 9 months ago

Diablo-D3 commented 9 months ago

Contributing guidelines

Module(s)

Pick

Description

Using...

require('mini.pick').setup({
  window = {
    config = {
      border = {
        { 'x', 'Red' }, { 'x', 'Red' }, { 'x', 'Red' },
        ' ',
        { 'x', 'Red' }, { 'x', 'Red' }, { 'x', 'Red' },
        ' '
      }
    }
  }
})

... causes Pick to show no results and immediately exit on any key press.

Neovim version

Git

Steps to reproduce

  1. nvim -nu minimal.lua
  2. Setup mini.pick as above
  3. :lua require('mini.pick').builtin.files()

Expected behavior

No response

Actual behavior

See above

echasnovski commented 9 months ago

Thanks for the issue!

I can reproduce it. It is because there is an error during opening 'mini.pick' window and currently no error is shown due to how getchar() works (didn't manage to properly make it happen without a flicker).

The error is in how 'mini.pick' tries to be smart and infer bottom border characters. Right now it assumes that border[6] is a string, which is not the case in this issue.

I'll fix it (hopefully) shortly.

echasnovski commented 9 months ago

This should be fixed on latest main.