Repository: microsoft/terminal
File: src/cascadia/TerminalApp/Pane.h (C/C++)

Code before:
    WINRT_CALLBACK(PaneRaiseBell, winrt::Windows::Foundation::EventHandler<bool>);
    WINRT_CALLBACK(Detached, winrt::delegate<std::shared_ptr<Pane>>);

private:
    struct PanePoint;
    struct PaneNeighborSearch;
    struct SnapSizeResult;
    struct SnapChildrenSizeResult;
    struct LayoutSizeNode;

    winrt::Windows::UI::Xaml::Controls::Grid _root{};
    winrt::Windows::UI::Xaml::Controls::Border _borderFirst{};
    winrt::Windows::UI::Xaml::Controls::Border _borderSecond{};
    static winrt::Windows::UI::Xaml::Media::SolidColorBrush s_focusedBorderBrush;
    static winrt::Windows::UI::Xaml::Media::SolidColorBrush s_unfocusedBorderBrush;

    // <--- SECTION FOR PROPERTIES THAT NEED TO BE TRANSFERRED BETWEEN CHILD/PARENT PANES UPON SPLITTING/CLOSING -->
    std::shared_ptr<Pane> _firstChild{ nullptr };
    std::shared_ptr<Pane> _secondChild{ nullptr };
    SplitState _splitState{ SplitState::None };
    float _desiredSplitPosition;
    winrt::Microsoft::Terminal::Control::TermControl _control{ nullptr };
    winrt::Microsoft::Terminal::TerminalConnection::ConnectionState _connectionState{ winrt::Microsoft::Terminal::TerminalConnection::ConnectionState::NotConnected };
    winrt::Microsoft::Terminal::Settings::Model::Profile _profile{ nullptr };
    bool _isDefTermSession{ false };
    // <--- END SECTION -->

    std::optional<uint32_t> _id;
    std::weak_ptr<Pane> _parentChildPath{};

    bool _lastActive{ false };
    winrt::event_token _connectionStateChangedToken{ 0 };
    winrt::event_token _firstClosedToken{ 0 };
    winrt::event_token _secondClosedToken{ 0 };
    winrt::event_token _warningBellToken{ 0 };

    winrt::Windows::UI::Xaml::UIElement::GotFocus_revoker _gotFocusRevoker;
    winrt::Windows::UI::Xaml::UIElement::LostFocus_revoker _lostFocusRevoker;

    std::shared_mutex _createCloseLock{};

    Borders _borders{ Borders::None };

    bool _zoomed{ false };

    winrt::Windows::Media::Playback::MediaPlayer _bellPlayer{ nullptr };
    winrt::Windows::Media::Playback::MediaPlayer::MediaEnded_revoker _mediaEndedRevoker;

    bool _IsLeaf() const noexcept;
    bool _HasFocusedChild() const noexcept;
    void _SetupChildCloseHandlers();

Review comment (bug):
```suggestion
#pragma region Properties that need to be transferred between child/parent panes upon splitting/closing
    std::shared_ptr<Pane> _firstChild{ nullptr };
    std::shared_ptr<Pane> _secondChild{ nullptr };
    SplitState _splitState{ SplitState::None };
    float _desiredSplitPosition;
    winrt::Microsoft::Terminal::Control::TermControl _control{ nullptr };
    winrt::Microsoft::Terminal::TerminalConnection::ConnectionState _connectionState{ winrt::Microsoft::Terminal::TerminalConnection::ConnectionState::NotConnected };
    winrt::Microsoft::Terminal::Settings::Model::Profile _profile{ nullptr };
    bool _isDefTermSession{ false };
#pragma endregion
```
nit: if you use `pragma region`, VS and VSCode let you expand/collapse it

Code after:
    WINRT_CALLBACK(PaneRaiseBell, winrt::Windows::Foundation::EventHandler<bool>);
    WINRT_CALLBACK(Detached, winrt::delegate<std::shared_ptr<Pane>>);

private:
    struct PanePoint;
    struct PaneNeighborSearch;
    struct SnapSizeResult;
    struct SnapChildrenSizeResult;
    struct LayoutSizeNode;

    winrt::Windows::UI::Xaml::Controls::Grid _root{};
    winrt::Windows::UI::Xaml::Controls::Border _borderFirst{};
    winrt::Windows::UI::Xaml::Controls::Border _borderSecond{};
    static winrt::Windows::UI::Xaml::Media::SolidColorBrush s_focusedBorderBrush;
    static winrt::Windows::UI::Xaml::Media::SolidColorBrush s_unfocusedBorderBrush;

#pragma region Properties that need to be transferred between child / parent panes upon splitting / closing
    std::shared_ptr<Pane> _firstChild{ nullptr };
    std::shared_ptr<Pane> _secondChild{ nullptr };
    SplitState _splitState{ SplitState::None };
    float _desiredSplitPosition;
    winrt::Microsoft::Terminal::Control::TermControl _control{ nullptr };
    winrt::Microsoft::Terminal::TerminalConnection::ConnectionState _connectionState{ winrt::Microsoft::Terminal::TerminalConnection::ConnectionState::NotConnected };
    winrt::Microsoft::Terminal::Settings::Model::Profile _profile{ nullptr };
    bool _isDefTermSession{ false };
#pragma endregion

    std::optional<uint32_t> _id;
    std::weak_ptr<Pane> _parentChildPath{};

    bool _lastActive{ false };
    winrt::event_token _connectionStateChangedToken{ 0 };
    winrt::event_token _firstClosedToken{ 0 };
    winrt::event_token _secondClosedToken{ 0 };
    winrt::event_token _warningBellToken{ 0 };

    winrt::Windows::UI::Xaml::UIElement::GotFocus_revoker _gotFocusRevoker;
    winrt::Windows::UI::Xaml::UIElement::LostFocus_revoker _lostFocusRevoker;

    std::shared_mutex _createCloseLock{};

    Borders _borders{ Borders::None };

    bool _zoomed{ false };

    winrt::Windows::Media::Playback::MediaPlayer _bellPlayer{ nullptr };
    winrt::Windows::Media::Playback::MediaPlayer::MediaEnded_revoker _mediaEndedRevoker;

    bool _IsLeaf() const noexcept;
    bool _HasFocusedChild() const noexcept;
    void _SetupChildCloseHandlers();