Skip to content

fix: selection highlight on last line and add Execute All shortcut (#770)#799

Merged
datlechin merged 2 commits intomainfrom
fix/selection-highlight-execute-all
Apr 19, 2026
Merged

fix: selection highlight on last line and add Execute All shortcut (#770)#799
datlechin merged 2 commits intomainfrom
fix/selection-highlight-execute-all

Conversation

@datlechin
Copy link
Copy Markdown
Collaborator

Summary

Closes #770 (items 2 and 3).

Selection highlight fix: The blue selection mask now correctly covers the last line when using Cmd+A or block selection. Root cause was in TextSelectionManager+FillRects.swift where rectForOffset returns nil at the document boundary, causing the last line's fill rect to be skipped entirely.

Execute All Statements (Cmd+Shift+Enter): New shortcut to run all statements in the editor sequentially, regardless of cursor position or selection. Industry-standard shortcut matching DBeaver and DataGrip. The safe mode dispatch logic was extracted from runQuery() into a shared dispatchStatements() helper to avoid duplication.

Changes

  • TextSelectionManager+FillRects.swift — fallback rect at document end instead of continue
  • SQLEditorView.swift — bottom content inset 0 → 8 for visual breathing room
  • MainContentCoordinator+ExecuteAll.swift — new extension with runAllStatements() and extracted dispatchStatements()
  • MainContentCoordinator.swiftrunQuery() now calls shared dispatchStatements()
  • TableProApp.swift — "Execute All Statements" menu item with Cmd+Shift+Enter
  • MainContentCommandActions.swiftrunAllStatements() passthrough

Test plan

  • Type multi-line SQL, press Cmd+A — last line fully highlighted
  • Type SELECT 1; SELECT 2; SELECT 3;, cursor on line 1, press Cmd+Shift+Enter — all 3 execute (3 result tabs)
  • Same query, Cmd+Enter — only SELECT 1 executes (statement at cursor)
  • Query menu shows "Execute All Statements" with Cmd+Shift+Enter
  • Safe mode: Execute All respects read-only and confirmation dialogs

@datlechin datlechin merged commit 823ddd6 into main Apr 19, 2026
2 checks passed
@datlechin datlechin deleted the fix/selection-highlight-execute-all branch April 19, 2026 15:48
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.

Performance Lag with Multiple SQL Windows, Selection Mask Bug, and Feature Request for Execution Options

1 participant