[PR #13598] [CLOSED] fix: correct cursor positioning when backspacing over line wrap #24825

Closed
opened 2026-04-19 17:49:50 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/13598
Author: @majiayu000
Created: 1/1/2026
Status: Closed

Base: mainHead: fix-13587-backspace-x-line-wrapping-bug-0102-0649


📝 Commits (1)

  • 9ef7d88 fix: correct cursor positioning when backspacing over line wrap

📊 Changes

1 file changed (+3 additions, -3 deletions)

View changed files

📝 readline/buffer.go (+3 -3)

📄 Description

Fixes #13587

Summary

When backspacing over a line wrap, the cursor was positioned at column Width (one past the last valid column) instead of Width-1 (the last character position). This caused the visual state and buffer to go out of sync - the original character remained visible on screen while the buffer correctly had it deleted.

Changes

  • Change CursorRightN(b.Width) to CursorRightN(b.Width-1) in MoveLeft() and Remove() functions
  • Ensures cursor positions at the actual last column when moving up a line

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ollama/ollama/pull/13598 **Author:** [@majiayu000](https://github.com/majiayu000) **Created:** 1/1/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix-13587-backspace-x-line-wrapping-bug-0102-0649` --- ### 📝 Commits (1) - [`9ef7d88`](https://github.com/ollama/ollama/commit/9ef7d88e8fbd953a2dd652e35d5640d552629f74) fix: correct cursor positioning when backspacing over line wrap ### 📊 Changes **1 file changed** (+3 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `readline/buffer.go` (+3 -3) </details> ### 📄 Description Fixes #13587 ## Summary When backspacing over a line wrap, the cursor was positioned at column `Width` (one past the last valid column) instead of `Width-1` (the last character position). This caused the visual state and buffer to go out of sync - the original character remained visible on screen while the buffer correctly had it deleted. ## Changes - Change `CursorRightN(b.Width)` to `CursorRightN(b.Width-1)` in `MoveLeft()` and `Remove()` functions - Ensures cursor positions at the actual last column when moving up a line --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-19 17:49:50 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#24825