Skip to content

Commit

Permalink
fix: Some keybinds not working (resolved)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomlin7 committed Nov 2, 2024
1 parent 61fe049 commit af8eb62
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 7 deletions.
2 changes: 2 additions & 0 deletions src/biscuit/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,11 @@ def split_editor(self, *_) -> None:

def change_tab_forward(self, *_) -> None:
self.base.editorsbar.change_tab_forward()
return "break"

def change_tab_back(self, *_) -> None:
self.base.editorsbar.change_tab_back()
return "break"

def maximize_biscuit(self, *_) -> None:
match platform.system():
Expand Down
12 changes: 10 additions & 2 deletions src/biscuit/layout/secondary_sidebar.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ def __init__(
self.columnconfigure(1, weight=1)

self.views = []

self.active_view = None
self.visible = False

self.secondary_activitybar = activitybar
self.secondary_activitybar.attach_sidebar(self)
Expand All @@ -45,7 +45,13 @@ def __init__(
def toggle(self) -> None:
"""Toggle the sidebar."""

self.show_explorer()
if self.visible:
self.hide()
else:
if not self.active_view:
self.show_source_control()
else:
self.pack()

def add_views(self, views: list[SideBarView]) -> None:
"""Adds multiple views to the sidebar at once."""
Expand Down Expand Up @@ -150,6 +156,8 @@ def show_extensions(self, *_) -> Extensions:

def pack(self):
super().pack(side=tk.LEFT, fill=tk.Y, after=self.base.contentpane, padx=(1, 0))
self.visible = True

def hide(self):
super().pack_forget()
self.visible = False
11 changes: 10 additions & 1 deletion src/biscuit/layout/sidebar.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ def __init__(

self.views = []
self.active_view = None
self.visible = False

self.activitybar = activitybar
self.activitybar.attach_sidebar(self)
Expand All @@ -42,7 +43,13 @@ def __init__(
def toggle(self) -> None:
"""Toggle the sidebar."""

self.show_explorer()
if self.visible:
self.hide()
else:
if not self.active_view:
self.show_explorer()
else:
self.pack()

def add_views(self, views: list[SideBarView]) -> None:
"""Adds multiple views to the sidebar at once."""
Expand Down Expand Up @@ -124,6 +131,8 @@ def show_debug(self, *_) -> Debug:

def pack(self):
super().pack(side=tk.LEFT, fill=tk.Y, before=self.base.contentpane, padx=(0, 1))
self.visible = True

def hide(self):
super().pack_forget()
self.visible = False
8 changes: 4 additions & 4 deletions src/biscuit/settings/bindings.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ def __init__(self, master: Settings) -> None:
self.undo = "<Control-z>"
self.redo = "<Control-y>"
self.restore_closed_tab = "<Control-T>"
self.close_all_tabs = "<Control-Shift-W>"
self.close_all_tabs = "<Control-W>"
self.change_tab = "<Control-Tab>"
self.change_tab_back = "<Control-Shift-Tab>"
self.split_tab = "<Control-\\>"

self.command_palette = "<Control-P>"
self.file_search = "<Control-p>"
self.symbol_outline = "<Control-J>"
self.symbol_outline = "<Control-j>"

self.panel = "<Control-grave>"
self.sidebar = "<Control-b>"
Expand All @@ -47,5 +47,5 @@ def __init__(self, master: Settings) -> None:
self.open_settings = "<Control-comma>"
self.restore_recent_session = "<Control-Alt-r>"
self.open_recent_folders = "<Control-r>"
self.open_recent_files = "<Control-Shift-r>"
self.open_recent_session = "<Control-Alt-R>"
self.open_recent_files = "<Control-R>"
self.open_recent_session = "<Control-Alt-r>"

0 comments on commit af8eb62

Please sign in to comment.