updateSplitView() used hardcoded grid positions that assumed the
sidebar was always visible, causing a crash when opening a split
view with the sidebar hidden.
closeSplit() also ignored the sidebar visibility state, causing
the sidebar to reappear when closing a split.
Fix both by checking hasSidebar() for correct column positions
and reusing buildGrid() in closeSplit().
Fixes: 66cf16c4 ("commands: add :toggle-sidebar command")
Signed-off-by: Matthew Phillips <matthew@matthewphillips.info>
Tested-by: Julio B <julio.bacel@gmail.com>
Acked-by: Robin Jarry <robin@jarry.cc>