Skip to content

Beautify (⌘I) duplicates query content when multiple cursors are active #3851

@bradley-pettman

Description

@bradley-pettman

Description

When multiple cursors are active and ⌘I (Beautify) is triggered, the
beautified query is inserted at each cursor position rather than replacing the
full document once. The result is a corrupted editor buffer containing one
copy of the beautified output per cursor.

Steps to Reproduce

  1. Open the SQL editor
  2. Enter a query:
select
*
FROM
users

3. Place multiple cursors (e.g. Option-click at the end of each line)
4. Press ⌘I to beautify

## Current Behavior

The beautified query is inserted at every cursor position, producing:

select SELECT
    *
FROM
    users
*SELECT
    *
FROM
    users
FROMSELECT
    *
FROM
    users
users SELECT
    *
FROM
    users

## Expected Behavior

Cursors are collapsed and the query is formatted once:

SELECT
    *
FROM
    users

## Environment

- App version: e.g TablePlus 6.9.2
- Database Version: MySQL 8.0.46
- macOS version: macOS Tahoe 26.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions