microsoft / microsoft/terminal

`Pane::_FindFocusAndNeighbor` can probably be simpler

Open
#10,748 0 comments 1 reaction 0 assignees View on GitHub
Area-CodeHealth Help Wanted Issue-Task Product-Terminal
Dominant language
C++
Stars
105k
Forks
9.6k
Avg merge
3d 17h
Merged PRs (30d)
29

Description

If we view this problem from the point of the focused pane, what this function (and the other) do is basically:
* move to the parent node
* check if the _other_ child node - the one the focused pane doesn't belong to - is in the direction we want to move the pane to
* if yes: swap panes
* if no: continue with the parent node

Is that correct?
If my understanding is correct, I believe we can simplify this code after it has been merged.

_Originally posted by @lhecker in https://github.com/microsoft/terminal/pull/10638#discussion_r674151375_

Contributor guide

Open the contributing guide

Research direction

Start by reading Pane::_FindFocusAndNeighbor and the other function referenced in the issue, then trace how focus moves through parent and sibling nodes. Confirm whether the described direction check and pane swap cover the current behavior; done means a simpler implementation that preserves the existing pane-navigation behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
desktop
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.