Skip to content

Commit

Permalink
fix resize issue
Browse files Browse the repository at this point in the history
  • Loading branch information
ms-jpq committed Aug 7, 2020
1 parent 2581487 commit 0db1cf9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion rplugin/python3/chadtree/wm.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

from .consts import fm_filetype, fm_namespace
from .fs import is_parent
from .logging import log
from .nvim import atomic
from .types import Badge, ClickType, Highlight, Settings, State

Expand Down Expand Up @@ -129,6 +130,7 @@ def new_window(nvim: Nvim, *, open_left: bool, width: int) -> Window:


def resize_fm_windows(nvim: Nvim, width: int) -> None:
log.debug("%s", "window resized", stack_info=True)
for window in find_fm_windows_in_tab(nvim):
nvim.api.win_set_width(window, width)

Expand All @@ -148,7 +150,7 @@ def ensure_side_window(
open_left = settings.open_left
windows = tuple(find_windows_in_tab(nvim, exclude=False))
target = windows[0] if open_left else windows[-1]
if window.number != target:
if window.number != target.number:
if open_left:
nvim.api.command("wincmd H")
else:
Expand Down

0 comments on commit 0db1cf9

Please sign in to comment.