Skip to content

Commit

Permalink
Merge pull request #1840 from timbrel/fix-initial-cursor
Browse files Browse the repository at this point in the history
  • Loading branch information
kaste authored Dec 13, 2023
2 parents 23dc79d + ad392c4 commit 04d78b2
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions core/interfaces/branch.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,13 @@ def cursor_is_on_active_branch():

cursor_was_on_active_branch = cursor_is_on_active_branch()
yield
if cursor_was_on_active_branch and not cursor_is_on_active_branch() or not on_special_symbol():
self.view.run_command("gs_branches_navigate_to_active_branch")
active_branch_available = any(b for b in self.state.get("branches", []) if b.active)
if active_branch_available:
if cursor_was_on_active_branch and not cursor_is_on_active_branch() or not on_special_symbol():
self.view.run_command("gs_branches_navigate_to_active_branch")
else:
if not on_special_symbol():
self.view.run_command("gs_branches_navigate_branch")

@ui.section("branch_status")
def render_branch_status(self, long_status):
Expand Down

0 comments on commit 04d78b2

Please sign in to comment.