Conversation
## 追加したテストケース
- test_insert_ascii: i → 文字入力 → Esc → :wq
- test_delete_line: dd → :wq
- test_open_line_below: o → 文字入力 → Esc → :wq
- test_insert_japanese: i → 日本語入力 → Esc → :wq
- test_yank_paste_line: yy → p → :wq
- test_delete_char_x: x → :wq
- test_backspace_join_lines: j → i → Backspace → Esc → :wq
## バグ修正(テスト実装中に発見)
**cursor.rs**: `editor_rows - 1` の u16 オーバーフロー修正
- PTY サイズが (0,0) のとき editor_rows=0 となり、`0u16 - 1` でパニックが発生
- move_to_bottom()・scroll() の 3 箇所を `saturating_sub(1)` に変更
**terminal.rs**: PTY サイズ (0,0) 時のフォールバック追加
- rexpect が作成する PTY のサイズが (0,0) で terminal_width=0 になり、
Insert モードでカーソルが移動できず文字が逆順に挿入される問題を修正
- (0,0) の場合は (80,24) をデフォルトサイズとして使用
**handler/insert.rs**: Key::Alt(':') ハンドラを追加
- PTY 経由で \x1b の直後に ':' が届くと termion が Key::Alt(':') として
解析するため、Insert モードでも ESC+: と同様に扱うよう対応
- Normal モードに戻り、Command モードに入る
**app.rs**: Insert → Command モード遷移時に command_buffer をクリア
- Normal → Command と同様の処理を Insert → Command でも実施
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
追加したテストケース
test_insert_asciii→ ASCII 入力 → ESC →:wqtest_delete_linedd→:wqtest_open_line_belowo→ 文字入力 → ESC →:wqtest_insert_japanesei→ 日本語入力 → ESC →:wqtest_yank_paste_lineyy→p→:wqtest_delete_char_xx→:wqtest_backspace_join_linesj→i→ Backspace → ESC →:wqバグ修正
cursor.rs:
editor_rows - 1の u16 オーバーフロー(3 箇所)(0, 0)のときeditor_rows = 0となり0u16 - 1でパニックが発生move_to_bottom()とscroll()をsaturating_sub(1)に変更terminal.rs: PTY サイズ
(0, 0)時のフォールバック(0, 0)→terminal_width = 0→ Insert モードでカーソルが動かず文字が逆順挿入される(0, 0)の場合は(80, 24)をデフォルトとして使用handler/insert.rs:
Key::Alt(':')ハンドラ追加\x1bの直後に:が届くと termion がKey::Alt(':')と解析するKey::Alt(':')を ESC +:と同等に処理(Normal → Command モード)app.rs: Insert → Command モード遷移時に
command_bufferをクリアTest plan
cargo test --test goldenが 9 テスト全てグリーンになることを確認cargo test --libが 54 テスト全てグリーンになることを確認🤖 Generated with Claude Code