mirror of
https://github.com/neovim/neovim.git
synced 2025-10-21 17:21:49 +00:00
API: Refactor: Register/unregister created/destroyed tabpages
- Add the 'handle' field to `tabpage_T` - Add declare/implement functions for registering/unregistering/retrieving tabpages - Register/unregister tabpages when they are created/destroyed.
This commit is contained in:
@@ -2845,6 +2845,7 @@ void win_init_size(void)
|
||||
static tabpage_T *alloc_tabpage(void)
|
||||
{
|
||||
tabpage_T *tp = xcalloc(1, sizeof(tabpage_T));
|
||||
handle_register_tabpage(tp);
|
||||
|
||||
/* init t: variables */
|
||||
tp->tp_vars = dict_alloc();
|
||||
@@ -2859,6 +2860,7 @@ void free_tabpage(tabpage_T *tp)
|
||||
{
|
||||
int idx;
|
||||
|
||||
handle_unregister_tabpage(tp);
|
||||
diff_clear(tp);
|
||||
for (idx = 0; idx < SNAP_COUNT; ++idx)
|
||||
clear_snapshot(tp, idx);
|
||||
|
Reference in New Issue
Block a user