diff --git a/doc/libmodal-lua.txt b/doc/libmodal-lua.txt index 88e558f..86fd7ab 100644 --- a/doc/libmodal-lua.txt +++ b/doc/libmodal-lua.txt @@ -349,7 +349,7 @@ VARIABLES *libmodal-lua-Popup-variables* - api.nvim_get_option('cmdheight') - 1, ['style'] = 'minimal', - ['width'] = 25 + ['width'] = 1 } < @@ -376,11 +376,22 @@ VARIABLES *libmodal-lua-Popup-variables* -------------------------------------------------------------------------------- FUNCTIONS *libmodal-lua-Popup-functions* -`self`:close() *libmodal-lua-Popup.close()* +`self`:close({keepBuffer}) *libmodal-lua-Popup.close()* - Close the window that this `Popup` represents. + Close the |Popup.window|. - Note: All variables of `Popup` are de-initialized after this method. + Note: Variables of |Popup| are de-initialized after this method. + + Parameters: ~ + {keepBuffer} A `boolean` that (when `true`) indicates the underlying +               |scratch-buffer| should be kept + +`self`:open() *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. `self`:refresh({inputBytes}) *libmodal-lua-Popup.refresh()* diff --git a/lua/libmodal/src/collections/Popup.lua b/lua/libmodal/src/collections/Popup.lua index 4b0f547..e9c45ff 100644 --- a/lua/libmodal/src/collections/Popup.lua +++ b/lua/libmodal/src/collections/Popup.lua @@ -53,7 +53,7 @@ end local _metaPopup = require('libmodal/src/classes').new(Popup.TYPE) --------------------------------------- +------------------------------------- --[[ SUMMARY: * Close `self.window` * The `self` is inert after calling this. @@ -61,14 +61,14 @@ local _metaPopup = require('libmodal/src/classes').new(Popup.TYPE) --[[ PARAMS: * `keep_buffer` => whether or not to keep `self.buffer`. ]] --------------------------------------- -function _metaPopup:close(keep_buffer) +------------------------------------- +function _metaPopup:close(keepBuffer) if valid(self.window) then api.nvim_win_close(self.window, false) self.window = nil end - if not keep_buffer then + if not keepBuffer then self.buffer = nil self._inputChars = nil end