Skip to content

Commit

Permalink
added always side bar
Browse files Browse the repository at this point in the history
  • Loading branch information
ms-jpq committed Aug 4, 2020
1 parent 68696f8 commit 9bb82b3
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions rplugin/python3/chadtree/wm.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,20 @@ def kill_fm_windows(nvim: Nvim, *, settings: Settings) -> None:
nvim.api.win_close(window, True)


def ensure_side_window(
nvim: Nvim, *, window: Window, state: State, settings: Settings
) -> None:
open_left = settings.open_left
windows = tuple(find_windows_in_tab(nvim))
target = windows[0] if open_left else windows[-1]
if window.number != target:

This comment has been minimized.

Copy link
@renanbrayner

renanbrayner Jan 21, 2023

this is never true when ['open_direction'] = 'right'

if open_left:
nvim.api.command("wincmd H")
else:
nvim.api.command("wincmd L")
resize_fm_windows(nvim, state.width)


def toggle_fm_window(nvim: Nvim, *, state: State, settings: Settings) -> None:
window: Optional[Window] = next(find_fm_windows_in_tab(nvim), None)
if window:
Expand All @@ -160,6 +174,7 @@ def toggle_fm_window(nvim: Nvim, *, state: State, settings: Settings) -> None:
nvim.api.command("setlocal signcolumn=no")
nvim.api.command("setlocal cursorline")
nvim.api.command("setlocal winfixwidth")
ensure_side_window(nvim, window=window, state=state, settings=settings)


def show_file(
Expand Down

2 comments on commit 9bb82b3

@poetaman
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ms-jpq If this was meant to open CHADTree in sidebar with full height, it doesn't work in current nvim. Please have a look, thanks!

@ms-jpq
Copy link
Owner Author

@ms-jpq ms-jpq commented on 9bb82b3 Aug 27, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh isse what you mean now ok will think about dis

Please sign in to comment.