rust-playground icon indicating copy to clipboard operation
rust-playground copied to clipboard

No automatic horizontal scrolling in multi-line selection mode

Open matthieu-m opened this issue 4 months ago • 2 comments

Behavior

On the playground, multi-cursor selection is supported with the ALT key being pressed. For example, given the following (invalid) Rust code:

impl X {
    fn foo() {
        let sql =
            u"SELECT
            u"    COALESCE(acquisitions.month, investments.month) AS month,
            u"    acquisitions.companies_acquired,
            u"    investments.companies_rec_investment
            u" FROM (
            u"    SELECT
            u"        acquired_month AS month,
            u"        COUNT(DISTINCT company_permalink) AS companies_acquired
            u"    FROM tutorial.crunchbase_acquisitions
            u"    GROUP BY 1
            u") acquisitions
            u"FULL JOIN (
            u"    SELECT
            u"        funded_month AS month,
            u"        COUNT(DISTINCT company_permalink) AS companies_rec_investment
            u"    FROM tutorial.crunchbase_investments
            u"    GROUP BY 1
            u")investments
            u"ON acquisitions.month = investments.month
            u"ORDER BY 1 DESC
            u";
            u"
    }
}

One can place the cursor right before SELECT, press ALT, and drag the mouse down and to the right, selecting the SQL query without any leading u".

If dragging the mouse further than the boundary of the text box -- for example because the "run" panel is present -- the text within the text box does not scroll horizontally. Instead, the mouse pointer will slide to be over the right-hand panel.

Surprisingly, the text beyond the edge of the text box is still selected, and can be copy/pasted.

Expectation

Multi-cursor selection works just like regular selection, and the text within the text box scrolls horizontally to keep the current position of the pointer visible.

Details

OS: Windows 11 Browser: Firefox 139.0.4 (64-bit)

matthieu-m avatar Jun 15 '25 17:06 matthieu-m