This PR fixes errors that occur when the target windows are too short to draw the minimap window with borders. For example, the height of the window is 2 and window_border is the default value: "single", it shows an error below. 1198041 fixes this.
Error executing vim.schedule lua callback: .../share/nvim/lazy/neominimap.nvim/lua/neominimap/util.lua:12: 'height' key must be a positive Integer
stack traceback:
[C]: in function 'f'
.../share/nvim/lazy/neominimap.nvim/lua/neominimap/util.lua:12: in function <.../share/nvim/lazy/neominimap.nvim/lua/neominimap/util.lua:9>
...hare/nvim/lazy/neominimap.nvim/lua/neominimap/window.lua:217: in function 'create_minimap_window'
...hare/nvim/lazy/neominimap.nvim/lua/neominimap/window.lua:387: in function 'refresh_minimap_window'
...hare/nvim/lazy/neominimap.nvim/lua/neominimap/window.lua:433: in function 'refresh_all_minimap_windows'
...m/lazy/neominimap.nvim/lua/neominimap/command/global.lua:19: in function <...m/lazy/neominimap.nvim/lua/neominimap/command/global.lua:16>
2. deal with rare border formats
Formats nvim_open_win accepts as border option are below.
string: "single", "shadow" and so on.
string[]: a table of characters
[string, string][]: a table of tuples containing a character and a highlight group
Thanks for your contribution! I appreciate the effort, but I have a different approach in mind for this feature. I’ll implement it my way, but feel free to provide any feedback or suggestions after it’s done.
1. deal with short windows
This PR fixes errors that occur when the target windows are too short to draw the minimap window with borders. For example, the height of the window is
2
andwindow_border
is the default value:"single"
, it shows an error below. 1198041 fixes this.2. deal with rare border formats
Formats
nvim_open_win
accepts asborder
option are below.string
:"single"
,"shadow"
and so on.string[]
: a table of characters[string, string][]
: a table of tuples containing a character and a highlight group2.1.
string[]
: a table of charactersThis takes
8
,4
,2
and1
character(s).2.2.
[string, string][]
: a table of tuples containing a character and a highlight groupAnd each character may be a tuple.