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
4 changes: 2 additions & 2 deletions .github/workflows/issue-code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,10 @@ jobs:
install -m 0755 "$HOME/.local/tools/jq-1.7.1/jq" "$HOME/.local/bin/jq"
jq --version

- name: Setup Rust toolchain (1.89)
- name: Setup Rust toolchain (1.90)
uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.89.0
toolchain: 1.90.0

- name: Cache Rust build (cargo + target)
uses: Swatinem/rust-cache@v2
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/preview-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,15 @@ jobs:
shell: bash
run: |
rustup set profile minimal
rustup toolchain install 1.89.0 --profile minimal --target ${{ matrix.target }}
rustup default 1.89.0
rustup toolchain install 1.90.0 --profile minimal
rustup default 1.90.0
rustup target add ${{ matrix.target }}

- name: Rust cache (target + registries)
uses: Swatinem/rust-cache@v2
with:
prefix-key: v1-preview
shared-key: preview-${{ matrix.target }}-rust-1.89
shared-key: preview-${{ matrix.target }}-rust-1.90
workspaces: |
code-rs -> target
codex-rs -> target
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/upstream-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ jobs:
if: steps.check_upstream.outputs.skip != 'true'
uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.89.0
toolchain: 1.90.0

- name: Add local bin to PATH
if: steps.check_upstream.outputs.skip != 'true'
Expand Down
1 change: 1 addition & 0 deletions code-rs/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions code-rs/cloud-tasks/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ serde_json = "1"
reqwest = { version = "0.12", features = ["json"] }
serde = { version = "1", features = ["derive"] }
unicode-width = "0.1"
unicode-segmentation = "1.12"
code-tui = { path = "../tui" }

[dev-dependencies]
Expand Down
12 changes: 11 additions & 1 deletion code-rs/cloud-tasks/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ use std::path::PathBuf;
use std::sync::Arc;
use std::time::Duration;
use std::time::Instant;
use unicode_segmentation::UnicodeSegmentation;
use tokio::sync::mpsc::UnboundedSender;
use tracing::info;
use tracing_subscriber::EnvFilter;
Expand Down Expand Up @@ -1202,7 +1203,16 @@ pub async fn run_main(cli: Cli, _code_linux_sandbox_exe: Option<PathBuf>) -> any
if let Some(m) = app.env_modal.as_mut() { m.query.push(ch); }
needs_redraw = true;
}
KeyCode::Backspace => { if let Some(m) = app.env_modal.as_mut() { m.query.pop(); } needs_redraw = true; }
KeyCode::Backspace => {
if let Some(m) = app.env_modal.as_mut() {
if let Some((idx, _)) = m.query.grapheme_indices(true).last() {
m.query.truncate(idx);
} else {
m.query.clear();
}
}
needs_redraw = true;
}
KeyCode::Down | KeyCode::Char('j') => { if let Some(m) = app.env_modal.as_mut() { m.selected = m.selected.saturating_add(1); } needs_redraw = true; }
KeyCode::Up | KeyCode::Char('k') => { if let Some(m) = app.env_modal.as_mut() { m.selected = m.selected.saturating_sub(1); } needs_redraw = true; }
KeyCode::Home => { if let Some(m) = app.env_modal.as_mut() { m.selected = 0; } needs_redraw = true; }
Expand Down
18 changes: 18 additions & 0 deletions code-rs/tui/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1222,6 +1222,24 @@ impl App<'_> {
}
AppEvent::KeyEvent(mut key_event) => {
if self.timing_enabled { self.timing.on_key(); }
#[cfg(windows)]
{
use crossterm::event::KeyCode;
use crossterm::event::KeyEventKind;
if matches!(key_event.kind, KeyEventKind::Repeat) {
match key_event.code {
KeyCode::Left
| KeyCode::Right
| KeyCode::Up
| KeyCode::Down
| KeyCode::Home
| KeyCode::End
| KeyCode::Backspace
| KeyCode::Delete => {}
_ => continue,
}
}
}
// On terminals without keyboard enhancement flags (notably some Windows
// Git Bash/mintty setups), crossterm may emit duplicate key-up events or
// only report releases. Track which keys were seen as pressed so matching
Expand Down
13 changes: 11 additions & 2 deletions code-rs/tui/src/bottom_pane/theme_selection_view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use code_core::config_types::ThemeName;
use crossterm::event::KeyCode;
use crossterm::event::KeyEvent;
use crossterm::event::KeyModifiers;
use unicode_segmentation::UnicodeSegmentation;
use ratatui::buffer::Buffer;
use ratatui::layout::Alignment;
use ratatui::layout::Rect;
Expand Down Expand Up @@ -1484,7 +1485,11 @@ impl ThemeSelectionView {
}
match s.step.get() {
CreateStep::Prompt => {
s.prompt.pop();
if let Some((idx, _)) = s.prompt.grapheme_indices(true).last() {
s.prompt.truncate(idx);
} else {
s.prompt.clear();
}
}
CreateStep::Action | CreateStep::Review => {
return;
Expand All @@ -1496,7 +1501,11 @@ impl ThemeSelectionView {
}
match s.step.get() {
CreateStep::Prompt => {
s.prompt.pop();
if let Some((idx, _)) = s.prompt.grapheme_indices(true).last() {
s.prompt.truncate(idx);
} else {
s.prompt.clear();
}
}
CreateStep::Action | CreateStep::Review => {
return;
Expand Down