mirror of
https://github.com/Iron-E/nvim-libmodal
synced 2024-11-16 12:13:32 +00:00
feat(Popup): allow override of default config
Before we did not allow the default config to be overridden, but now we do.
This commit is contained in:
parent
0f9b51cb0c
commit
81abfff50c
@ -386,13 +386,20 @@ FUNCTIONS *libmodal-lua-Popup-functions*
|
|||||||
{keepBuffer} A `boolean` that (when `true`) indicates the underlying
|
{keepBuffer} A `boolean` that (when `true`) indicates the underlying
|
||||||
|scratch-buffer| should be kept
|
|scratch-buffer| should be kept
|
||||||
|
|
||||||
`self`:open() *libmodal-lua-Popup.open()*
|
`self`:open({config}) *libmodal-lua-Popup.open()*
|
||||||
|
|
||||||
Open the |Popup.window|.
|
Open the |Popup.window|.
|
||||||
|
|
||||||
Note: if the |Popup.window| is already open, then it will be reopened in
|
Note: if the |Popup.window| is already open, then it will be reopened in
|
||||||
case the |current_tabpage| has changed.
|
case the |current_tabpage| has changed.
|
||||||
|
|
||||||
|
In this case, it will also override the default options with the
|
||||||
|
options in the window so there is no need to pass in {config} a
|
||||||
|
second time.
|
||||||
|
|
||||||
|
Parameters: ~
|
||||||
|
{config} Same as |nvim_open_win| {config}.
|
||||||
|
|
||||||
`self`:refresh({inputBytes}) *libmodal-lua-Popup.refresh()*
|
`self`:refresh({inputBytes}) *libmodal-lua-Popup.refresh()*
|
||||||
|
|
||||||
Update the content of the `Popup` using an array-like `table` of
|
Update the content of the `Popup` using an array-like `table` of
|
||||||
|
@ -81,8 +81,8 @@ end
|
|||||||
* If the popup was already open, close it and re-open it.
|
* If the popup was already open, close it and re-open it.
|
||||||
]]
|
]]
|
||||||
--------------------------
|
--------------------------
|
||||||
function _metaPopup:open()
|
function _metaPopup:open(config)
|
||||||
local config = Popup.config
|
if not config then config = Popup.config end
|
||||||
|
|
||||||
if valid(self.window) then
|
if valid(self.window) then
|
||||||
config = vim.tbl_extend('force', config, api.nvim_win_get_config(self.window))
|
config = vim.tbl_extend('force', config, api.nvim_win_get_config(self.window))
|
||||||
|
Loading…
Reference in New Issue
Block a user