Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion crates/barsql-ui/src/editor_commands.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::ops::Range;

use gpui_kit::base::input::{AddCursorAbove, AddCursorBelow};
use gpui_kit::base::input::{AddCursorAbove, AddCursorBelow, SelectToEnd, SelectToStart};
use gpui_kit::component::RopeExt as _;
use gpui_kit::component::input::{
Backspace, Copy, Cut, DeleteToNextWordEnd, DeleteToPreviousWordStart, EditorState, Escape, GoToDefinition, Paste,
Expand Down Expand Up @@ -70,6 +70,11 @@ pub fn init(cx: &mut App) {
KeyBinding::new("ctrl-shift-down", AddCursorBelow, context),
]);
}
// GPUI Kit leaves Shift+PageUp/PageDown unbound; they select to the top/bottom of the query.
cx.bind_keys([
KeyBinding::new("shift-pageup", SelectToStart, context),
KeyBinding::new("shift-pagedown", SelectToEnd, context),
]);
}

// `comment` is the language's line comment prefix. None disables Toggle Comment.
Expand Down
1 change: 1 addition & 0 deletions guide/editor.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- **Function completion and hover** for every engine - each dialect's built-in functions (from about 150 on SQLite to over 400 on ClickHouse) plus the server's own (user functions, extensions, ClickHouse combinators like `sumIf`), each with its signatures, return type and a short description
- Driver-correct identifier quoting (PostgreSQL, MySQL, SQLite, SQL Server `[brackets]`, ClickHouse)
- **VS Code-style multiple cursors** - `Ctrl/⌘+D` adds a cursor at the next occurrence of the word or selection, `Ctrl/⌘+Shift+L` at every one, `Ctrl/⌘+K Ctrl/⌘+D` skips one and `Ctrl/⌘+U` takes the last back
- **Select to the top or bottom** - `Shift+PageUp` / `Shift+PageDown` select from the caret to the start or end of the query, as `Shift+Home` / `Shift+End` do for the line
- **Occurrence highlighting** - the word at the caret, or the selected text, is marked wherever else it appears
- **VS Code-style line commands** - copy, cut and paste whole lines, move and duplicate lines, toggle comments
- **Run selection** (`Ctrl/⌘+Enter`) - with nothing selected it runs the statement under the caret, briefly highlighting it / **run all** (`Ctrl/⌘+Shift+Enter`) / **stop** long-running queries
Expand Down