feat(Popup): allow override of default config

Before we did not allow the default config to be overridden, but now we
do.
pull/14/head release/0.9.4
Iron-E 4 years ago
parent 0f9b51cb0c
commit 81abfff50c
No known key found for this signature in database
GPG Key ID: 19B71B7B7B021D22

@ -386,13 +386,20 @@ FUNCTIONS *libmodal-lua-Popup-functions*
{keepBuffer} A `boolean` that (when `true`) indicates the underlying
              |scratch-buffer| should be kept
`self`:open() *libmodal-lua-Popup.open()*
`self`:open({config}) *libmodal-lua-Popup.open()*
Open the |Popup.window|.
Note: if the |Popup.window| is already open, then it will be reopened in
      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()*
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.
]]
--------------------------
function _metaPopup:open()
local config = Popup.config
function _metaPopup:open(config)
if not config then config = Popup.config end
if valid(self.window) then
config = vim.tbl_extend('force', config, api.nvim_win_get_config(self.window))

Loading…
Cancel
Save