Skip to content

Commit cfeef52

Browse files
committed
Merge origin/main: pick up workflow and cloud task updates
2 parents f454150 + a06c102 commit cfeef52

File tree

8 files changed

+49
-9
lines changed

8 files changed

+49
-9
lines changed

.github/workflows/issue-code.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,10 +148,10 @@ jobs:
148148
install -m 0755 "$HOME/.local/tools/jq-1.7.1/jq" "$HOME/.local/bin/jq"
149149
jq --version
150150
151-
- name: Setup Rust toolchain (1.89)
151+
- name: Setup Rust toolchain (1.90)
152152
uses: dtolnay/rust-toolchain@master
153153
with:
154-
toolchain: 1.89.0
154+
toolchain: 1.90.0
155155

156156
- name: Cache Rust build (cargo + target)
157157
uses: Swatinem/rust-cache@v2

.github/workflows/preview-build.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,15 @@ jobs:
6464
shell: bash
6565
run: |
6666
rustup set profile minimal
67-
rustup toolchain install 1.89.0 --profile minimal --target ${{ matrix.target }}
68-
rustup default 1.89.0
67+
rustup toolchain install 1.90.0 --profile minimal
68+
rustup default 1.90.0
69+
rustup target add ${{ matrix.target }}
6970
7071
- name: Rust cache (target + registries)
7172
uses: Swatinem/rust-cache@v2
7273
with:
7374
prefix-key: v1-preview
74-
shared-key: preview-${{ matrix.target }}-rust-1.89
75+
shared-key: preview-${{ matrix.target }}-rust-1.90
7576
workspaces: |
7677
code-rs -> target
7778
codex-rs -> target

.github/workflows/upstream-merge.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ jobs:
254254
if: steps.check_upstream.outputs.skip != 'true'
255255
uses: dtolnay/rust-toolchain@master
256256
with:
257-
toolchain: 1.89.0
257+
toolchain: 1.90.0
258258

259259
- name: Add local bin to PATH
260260
if: steps.check_upstream.outputs.skip != 'true'

code-rs/Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

code-rs/cloud-tasks/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ serde_json = "1"
3030
reqwest = { version = "0.12", features = ["json"] }
3131
serde = { version = "1", features = ["derive"] }
3232
unicode-width = "0.1"
33+
unicode-segmentation = "1.12"
3334
code-tui = { path = "../tui" }
3435

3536
[dev-dependencies]

code-rs/cloud-tasks/src/lib.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ use std::path::PathBuf;
1212
use std::sync::Arc;
1313
use std::time::Duration;
1414
use std::time::Instant;
15+
use unicode_segmentation::UnicodeSegmentation;
1516
use tokio::sync::mpsc::UnboundedSender;
1617
use tracing::info;
1718
use tracing_subscriber::EnvFilter;
@@ -1202,7 +1203,16 @@ pub async fn run_main(cli: Cli, _code_linux_sandbox_exe: Option<PathBuf>) -> any
12021203
if let Some(m) = app.env_modal.as_mut() { m.query.push(ch); }
12031204
needs_redraw = true;
12041205
}
1205-
KeyCode::Backspace => { if let Some(m) = app.env_modal.as_mut() { m.query.pop(); } needs_redraw = true; }
1206+
KeyCode::Backspace => {
1207+
if let Some(m) = app.env_modal.as_mut() {
1208+
if let Some((idx, _)) = m.query.grapheme_indices(true).last() {
1209+
m.query.truncate(idx);
1210+
} else {
1211+
m.query.clear();
1212+
}
1213+
}
1214+
needs_redraw = true;
1215+
}
12061216
KeyCode::Down | KeyCode::Char('j') => { if let Some(m) = app.env_modal.as_mut() { m.selected = m.selected.saturating_add(1); } needs_redraw = true; }
12071217
KeyCode::Up | KeyCode::Char('k') => { if let Some(m) = app.env_modal.as_mut() { m.selected = m.selected.saturating_sub(1); } needs_redraw = true; }
12081218
KeyCode::Home => { if let Some(m) = app.env_modal.as_mut() { m.selected = 0; } needs_redraw = true; }

code-rs/tui/src/app.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1222,6 +1222,24 @@ impl App<'_> {
12221222
}
12231223
AppEvent::KeyEvent(mut key_event) => {
12241224
if self.timing_enabled { self.timing.on_key(); }
1225+
#[cfg(windows)]
1226+
{
1227+
use crossterm::event::KeyCode;
1228+
use crossterm::event::KeyEventKind;
1229+
if matches!(key_event.kind, KeyEventKind::Repeat) {
1230+
match key_event.code {
1231+
KeyCode::Left
1232+
| KeyCode::Right
1233+
| KeyCode::Up
1234+
| KeyCode::Down
1235+
| KeyCode::Home
1236+
| KeyCode::End
1237+
| KeyCode::Backspace
1238+
| KeyCode::Delete => {}
1239+
_ => continue,
1240+
}
1241+
}
1242+
}
12251243
// On terminals without keyboard enhancement flags (notably some Windows
12261244
// Git Bash/mintty setups), crossterm may emit duplicate key-up events or
12271245
// only report releases. Track which keys were seen as pressed so matching

code-rs/tui/src/bottom_pane/theme_selection_view.rs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ use code_core::config_types::ThemeName;
44
use crossterm::event::KeyCode;
55
use crossterm::event::KeyEvent;
66
use crossterm::event::KeyModifiers;
7+
use unicode_segmentation::UnicodeSegmentation;
78
use ratatui::buffer::Buffer;
89
use ratatui::layout::Alignment;
910
use ratatui::layout::Rect;
@@ -1484,7 +1485,11 @@ impl ThemeSelectionView {
14841485
}
14851486
match s.step.get() {
14861487
CreateStep::Prompt => {
1487-
s.prompt.pop();
1488+
if let Some((idx, _)) = s.prompt.grapheme_indices(true).last() {
1489+
s.prompt.truncate(idx);
1490+
} else {
1491+
s.prompt.clear();
1492+
}
14881493
}
14891494
CreateStep::Action | CreateStep::Review => {
14901495
return;
@@ -1496,7 +1501,11 @@ impl ThemeSelectionView {
14961501
}
14971502
match s.step.get() {
14981503
CreateStep::Prompt => {
1499-
s.prompt.pop();
1504+
if let Some((idx, _)) = s.prompt.grapheme_indices(true).last() {
1505+
s.prompt.truncate(idx);
1506+
} else {
1507+
s.prompt.clear();
1508+
}
15001509
}
15011510
CreateStep::Action | CreateStep::Review => {
15021511
return;

0 commit comments

Comments
 (0)