Repository: microsoft/terminal
File: src/cascadia/TerminalControl/TermControl.cpp (C++)

Code before:
        _showContextMenuAt(_toControlOrigin(cursorPos));
    }

    double TermControl::QuickFixButtonWidth()
    {
        const auto leftPadding = GetPadding().Left;
        if (_quickFixButtonCollapsible)
        {
            const auto cellWidth = CharacterDimensions().Width;
            if (leftPadding == 0)
            {
                return cellWidth;
            }
            return leftPadding + (cellWidth / 2.0);
        }
        return leftPadding;
    }

    double TermControl::QuickFixButtonCollapsedWidth()
    {
        return std::max(CharacterDimensions().Width * 2.0 / 3.0, GetPadding().Left);
    }

    bool TermControl::OpenQuickFixMenu()
    {
        if (Feature_QuickFix::IsEnabled() && _core.QuickFixesAvailable())
        {
            // Expand the quick fix button if it's collapsed (looks nicer)
            if (_quickFixButtonCollapsible)
            {
                VisualStateManager::GoToState(*this, StateNormal, false);
            }
            auto quickFixBtn = QuickFixButton();
            quickFixBtn.Flyout().ShowAt(quickFixBtn);
            return true;
        }
        return false;
    }

    void TermControl::RefreshQuickFixMenu()
    {
        if (!Feature_QuickFix::IsEnabled())
        {
            return;
        }

        auto quickFixBtn = QuickFixButton();
        if (!_core.QuickFixesAvailable())
        {
            quickFixBtn.Visibility(Visibility::Collapsed);
            return;

Review comment (suggestion):
nit: prefer `if constexpr` for feature checks, even if it means introducing another level of nesting

Code after:
        _showContextMenuAt(_toControlOrigin(cursorPos));
    }

    double TermControl::QuickFixButtonWidth()
    {
        const auto leftPadding = GetPadding().Left;
        if (_quickFixButtonCollapsible)
        {
            const auto cellWidth = CharacterDimensions().Width;
            if (leftPadding == 0)
            {
                return cellWidth;
            }
            return leftPadding + (cellWidth / 2.0);
        }
        return leftPadding;
    }

    double TermControl::QuickFixButtonCollapsedWidth()
    {
        return std::max(CharacterDimensions().Width * 2.0 / 3.0, GetPadding().Left);
    }

    bool TermControl::OpenQuickFixMenu()
    {
        if constexpr (Feature_QuickFix::IsEnabled())
        {
            if (_core.QuickFixesAvailable())
            {
                // Expand the quick fix button if it's collapsed (looks nicer)
                if (_quickFixButtonCollapsible)
                {
                    VisualStateManager::GoToState(*this, StateNormal, false);
                }
                auto quickFixBtn = QuickFixButton();
                quickFixBtn.Flyout().ShowAt(quickFixBtn);
                return true;
            }
        }
        return false;
    }

    void TermControl::RefreshQuickFixMenu()
    {
        if (!Feature_QuickFix::IsEnabled())
        {
            return;
        }

        auto quickFixBtn = QuickFixButton();
        if (!_core.QuickFixesAvailable())