Skip to content
Merged
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ jobs:
fail-fast: false
matrix:
toolchain:
- &MSRV "1.98"
- nightly
- &MSRV "1.99"
target:
# Tier 1 platforms
- aarch64-apple-darwin # ARM64 macOS (11.0+, Big Sur+)
Expand Down
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ keywords = ["editor", "terminal", "text-editor"]
categories = ["text-editors", "development-tools"]
include = ["src/", "tests/", "Cargo.toml", "Cargo.lock", "COPYRIGHT", "LICENSE-*"]
version = "0.3.3"
rust-version = "1.98"
rust-version = "1.99"
authors = ["Ilaï Deutel"]
license = "MIT OR Apache-2.0"
edition = "2024"
Expand Down Expand Up @@ -120,6 +120,7 @@ same_name_method = "deny"
semicolon_outside_block = "deny"
separated_literal_suffix = "deny"
str_to_string = "deny"
unnecessary_rest_pattern = "deny"
unused_result_ok = "deny"
unwrap_used = "deny"
use_debug = "deny"
Expand Down
14 changes: 8 additions & 6 deletions src/editor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,10 @@ impl Editor {
}
self.cursor.x = cursor_x;
}
// ← at the beginning of the line: move to the end of the previous line. The x
// position will be adjusted after this `match` to accommodate the current row
// length, so we can just set here to the maximum possible value here.
// ← at the beginning of the line: move to the end of the previous
// line. The x position will be adjusted after this `match` to
// accommodate the current row length, so we can just set here to
// the maximum possible value here.
(AKey::Left, _) if self.cursor.y > 0 =>
(self.cursor.y, self.cursor.x) = (self.cursor.y - 1, usize::MAX),
(AKey::Right, Some(row)) if self.cursor.x < row.chars.len() => {
Expand All @@ -204,8 +205,8 @@ impl Editor {
self.cursor.x = cursor_x;
}
(AKey::Right, Some(_)) => self.cursor.move_to_next_line(),
// TODO: For Up and Down, move self.cursor.x to be consistent with tabs and UTF-8
// characters, i.e. according to rx
// TODO: For Up and Down, move self.cursor.x to be consistent with
// tabs and UTF-8 characters, i.e. according to rx
(AKey::Up, _) if self.cursor.y > 0 => self.cursor.y -= 1,
(AKey::Down, Some(_)) => self.cursor.y += 1,
_ => (),
Expand Down Expand Up @@ -832,7 +833,8 @@ impl PromptMode {
PromptState::Active(b) => return Some(Self::GoTo(b)),
PromptState::Cancelled => (),
PromptState::Completed(b) => {
let mut split = b.splitn(2, ':')
let mut split = b
.splitn(2, ':')
// saturating_sub: Lines and cols are 1-indexed
.map(|u| u.trim().parse().map(|s: usize| s.saturating_sub(1)));
match (split.next().transpose(), split.next().transpose()) {
Expand Down
Loading