What is the difference between hide and unmount? #316
-
I'm having a hard time understanding the conceptual difference between hide and unmount from the layout docs. When would one use unmount over hide or unmount over hide? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Say you If you do If you do ref: https://github.com/MunifTanjim/nui.nvim/tree/main/lua/nui/popup#popuphide |
Beta Was this translation helpful? Give feedback.
:hide
doesn't do any cleanup,:unomunt
does cleanup.Say you
:mount
a popup, then modify it's content (e.g. write something on the buffer).If you do
:hide
, that modified buffer content will be preserved. If you do:show
afterwards, you'll see the same content.If you do
:unmount
, the buffer will be destroyed (along with other stuffs, e.g. keymaps). If you do:mount
/:show
afterwards, a new buffer will be created.ref: https://github.com/MunifTanjim/nui.nvim/tree/main/lua/nui/popup#popuphide