@oh-my-pi/pi-tui 6.7.670 → 6.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oh-my-pi/pi-tui",
3
- "version": "6.7.670",
3
+ "version": "6.8.1",
4
4
  "description": "Terminal User Interface library with differential rendering for efficient text-based applications",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
@@ -290,6 +290,7 @@ export class Editor implements Component, Focusable {
290
290
  private autocompleteList?: SelectList;
291
291
  private isAutocompleting: boolean = false;
292
292
  private autocompletePrefix: string = "";
293
+ public onAutocompleteUpdate?: () => void;
293
294
 
294
295
  // Paste tracking for large pastes
295
296
  private pastes: Map<number, string> = new Map();
@@ -689,6 +690,7 @@ export class Editor implements Component, Focusable {
689
690
  // Only pass arrow keys to the list, not Enter/Tab (we handle those directly)
690
691
  if (matchesKey(data, "up") || matchesKey(data, "down")) {
691
692
  this.autocompleteList.handleInput(data);
693
+ this.onAutocompleteUpdate?.();
692
694
  return;
693
695
  }
694
696
 
package/src/tui.ts CHANGED
@@ -1090,7 +1090,9 @@ export class TUI extends Container {
1090
1090
  this.terminal.write(buffer);
1091
1091
 
1092
1092
  // Track cursor position for next render
1093
- this.cursorRow = finalCursorRow;
1093
+ // cursorRow represents end-of-content for viewport calculations,
1094
+ // hardwareCursorRow tracks actual cursor position (may move to cursorPos below)
1095
+ this.cursorRow = Math.max(0, newLines.length - 1);
1094
1096
  this.hardwareCursorRow = finalCursorRow;
1095
1097
 
1096
1098
  // Position hardware cursor for IME