mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-04-28 03:30:40 +00:00
getPositionFromOffsets used different per-line length calculations and different comparison operators for start vs end offsets, producing asymmetric and sometimes invalid results at line boundaries. Concrete failure: lines=['abc','def'], endOffset=4 (the position after the newline at offset 3). The start calc correctly resolved this to (row=1,col=0), but the end calc used lineLength=length (no +1 for the last-line case) combined with >= and returned (row=0,col=4) — an out-of-bounds column on a 3-char line. Downstream, replaceRangeInternal rejects endCol > currentLineLen(endRow) as an invalid range and silently returns state unchanged. This caused vim line-change commands (vim_change_movement 'j'/'k', vim_change_line spanning row boundaries) to no-op while still pushing an empty undo frame. Replace both loops with a single offsetToRowCol helper that matches the original start-calc logic, and update the vim 'change multiple lines down' test whose expectation was baked around the silent no-op. |
||
|---|---|---|
| .. | ||
| channels | ||
| cli | ||
| core | ||
| sdk-java | ||
| sdk-typescript | ||
| vscode-ide-companion | ||
| web-templates | ||
| webui | ||
| zed-extension | ||