Commit 7570588
fix: three correctness bugs in input state management
- SetCell sheet: 0 → active_sheet: cells edited on Sheet 2+ were
silently written to Sheet 1, causing data loss in multi-sheet
workbooks. handle_insert now receives workbook.active_sheet from
handle_key and passes it through to all three SetCell sites
(Esc / Enter / Tab commit).
- key_buffer + key_buffer_count not cleared on Esc: typing a prefix
key (g, d, y, @, …) then pressing Esc left stale state in
key_buffer/key_buffer_count so the next keypress was wrongly
matched as the second key of the abandoned sequence.
- count_buffer leak through multi-key handler: digits typed between
the first and second key of a two-key sequence were never consumed,
leaving a phantom count that affected the next Normal-mode action.
Added count_buffer.clear() immediately after key_buffer_count is
taken in the multi-key dispatcher.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 1e0ba7c commit 7570588
1 file changed
Lines changed: 13 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
872 | 872 | | |
873 | 873 | | |
874 | 874 | | |
875 | | - | |
| 875 | + | |
876 | 876 | | |
877 | 877 | | |
878 | 878 | | |
| |||
927 | 927 | | |
928 | 928 | | |
929 | 929 | | |
| 930 | + | |
930 | 931 | | |
931 | 932 | | |
932 | 933 | | |
| |||
1377 | 1378 | | |
1378 | 1379 | | |
1379 | 1380 | | |
| 1381 | + | |
| 1382 | + | |
1380 | 1383 | | |
1381 | 1384 | | |
1382 | 1385 | | |
| |||
1603 | 1606 | | |
1604 | 1607 | | |
1605 | 1608 | | |
1606 | | - | |
| 1609 | + | |
| 1610 | + | |
| 1611 | + | |
| 1612 | + | |
| 1613 | + | |
| 1614 | + | |
1607 | 1615 | | |
1608 | 1616 | | |
1609 | 1617 | | |
| |||
1708 | 1716 | | |
1709 | 1717 | | |
1710 | 1718 | | |
1711 | | - | |
| 1719 | + | |
1712 | 1720 | | |
1713 | 1721 | | |
1714 | 1722 | | |
| |||
1731 | 1739 | | |
1732 | 1740 | | |
1733 | 1741 | | |
1734 | | - | |
| 1742 | + | |
1735 | 1743 | | |
1736 | 1744 | | |
1737 | 1745 | | |
| |||
1758 | 1766 | | |
1759 | 1767 | | |
1760 | 1768 | | |
1761 | | - | |
| 1769 | + | |
1762 | 1770 | | |
1763 | 1771 | | |
1764 | 1772 | | |
| |||
0 commit comments