Skip to content

Fix Ctrl+C copy shortcut in SQL editor log/statistics view#476

Merged
mariuz merged 2 commits intomasterfrom
copilot/support-new-keyboard-shortcuts
Mar 25, 2026
Merged

Fix Ctrl+C copy shortcut in SQL editor log/statistics view#476
mariuz merged 2 commits intomasterfrom
copilot/support-new-keyboard-shortcuts

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 25, 2026

The Edit menu's Ctrl+C accelerator intercepted the keypress and called OnMenuCopy, which had no handler for vmLogCtrl mode — so copy was silently dropped. Ctrl+Insert worked because it bypasses the wxWidgets menu accelerator system and is handled directly by Scintilla's internal key map.

Changes

  • OnMenuCopy: Added vmLogCtrl branch to call styled_text_ctrl_stats->Copy(), consistent with how OnMenuSelectAll already handled all three view modes.
  • OnMenuUpdateCopy: Added vmLogCtrl branch to enable the Copy menu item when text is selected in the stats control, using GetSelectionStart() != GetSelectionEnd() (same pattern as TextControl::OnCommandUpdateCopy).
// Before
void ExecuteSqlFrame::OnMenuCopy(...) {
    if (viewModeM == vmEditor)
        styled_text_ctrl_sql->Copy();
    else if (viewModeM == vmGrid)
        grid_data->copyToClipboard(false);
    // vmLogCtrl: nothing — Ctrl+C silently dropped
}

// After
void ExecuteSqlFrame::OnMenuCopy(...) {
    if (viewModeM == vmEditor)
        styled_text_ctrl_sql->Copy();
    else if (viewModeM == vmLogCtrl)
        styled_text_ctrl_stats->Copy();
    else if (viewModeM == vmGrid)
        grid_data->copyToClipboard(false);
}

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

When the statistics/log view (vmLogCtrl) was active in the SQL editor
window, pressing Ctrl+C did nothing because OnMenuCopy only handled
vmEditor and vmGrid modes. The frame's Edit menu accelerator captured
Ctrl+C and called OnMenuCopy, which skipped the vmLogCtrl case entirely.

- Add vmLogCtrl handling in OnMenuCopy to call styled_text_ctrl_stats->Copy()
- Add vmLogCtrl handling in OnMenuUpdateCopy to enable Copy when text is
  selected in the statistics/log view

Co-authored-by: mariuz <18359+mariuz@users.noreply.github.com>
Agent-Logs-Url: https://github.com/mariuz/flamerobin/sessions/6e42adab-f5d3-44b9-86a6-ac8a1e0ce6a3
Copilot AI changed the title [WIP] Add support for newer keyboard shortcuts in log window Fix Ctrl+C copy shortcut in SQL editor log/statistics view Mar 25, 2026
Copilot AI requested a review from mariuz March 25, 2026 16:46
@mariuz mariuz marked this pull request as ready for review March 25, 2026 18:45
@mariuz mariuz merged commit fa97c82 into master Mar 25, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants