aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPolesznyák Márk <contact@pml68.dev>2025-10-21 17:34:52 +0200
committerPolesznyák Márk <contact@pml68.dev>2025-10-21 17:34:52 +0200
commite49a19b923ef954ea1130ab6455c5e2c3f8ef426 (patch)
tree54f639bbf69db2f4be61310f2a7684af6f10d940
parentfix: `Selection::text` not accounting for graphemes larger than 1 byte (diff)
downloadiced_selection-e49a19b923ef954ea1130ab6455c5e2c3f8ef426.tar.gz
docs: list keyboard shortcuts under `text` module
-rw-r--r--.cargo/config.toml4
-rw-r--r--src/text.rs17
2 files changed, 19 insertions, 2 deletions
diff --git a/.cargo/config.toml b/.cargo/config.toml
index feb6aad..0b59599 100644
--- a/.cargo/config.toml
+++ b/.cargo/config.toml
@@ -1,3 +1,3 @@
[alias]
-lint = "clippy --no-deps -- -D warnings"
-lint-all = "clippy --no-deps -- -D clippy::pedantic"
+lint = "clippy --all-features --no-deps -- -D warnings"
+lint-all = "clippy --all-features --no-deps -- -D clippy::pedantic"
diff --git a/src/text.rs b/src/text.rs
index 9957b5f..f911a39 100644
--- a/src/text.rs
+++ b/src/text.rs
@@ -1,4 +1,21 @@
//! Text widgets display information through writing.
+//!
+//! Keyboard shortcuts (applies to both [`Text`] and [`Rich`]):
+//!
+//! |MacOS|Linux/Windows|Effect|
+//! |-|-|-|
+//! |`Cmd + A`|`Ctrl + A`|Selects all text in the currently focused paragraph|
+//! |`Cmd + C`|`Ctrl + C`|Copies the selected text to clipboard|
+//! |`Shift + Left Arrow`|`Shift + Left Arrow`|Moves the selection to the left by one character|
+//! |`Shift + Right Arrow`|`Shift + Right Arrow`|Moves the selection to the right by one character|
+//! |`Shift + Opt + Left Arrow`|`Shift + Ctrl + Left Arrow`|Extends the selection to the previous start of a word|
+//! |`Shift + Opt + Right Arrow`|`Shift + Ctrl + Right Arrow`|Extends the selection to the next end of a word|
+//! |`Shift + Home`<br>`Shift + Cmd + Left Arrow`<br>`Shift + Opt + Up Arrow`|`Shift + Home`<br>`Shift + Ctrl + Up Arrow`|Selects to the beginning of the line|
+//! |`Shift + End`<br>`Shift + Cmd + Right Arrow`<br>`Shift + Opt + Down Arrow`|`Shift + End`<br>`Shift + Ctrl + Down Arrow`|Selects to the end of the line|
+//! |`Shift + Up Arrow`|`Shift + Up Arrow`|Moves the selection up by one line if possible, or to the start of the current line otherwise|
+//! |`Shift + Down Arrow`|`Shift + Down Arrow`|Moves the selection down by one line if possible, or to the end of the current line otherwise|
+//! |`Shift + Opt + Home`<br>`Shift + Cmd + Up Arrow`|`Shift + Ctrl + Home`|Selects to the beginning of the paragraph|
+//! |`Shift + Opt + End`<br>`Shift + Cmd + Down Arrow`|`Shift + Ctrl + End`|Selects to the end of the paragraph|
mod rich;
use iced_widget::{