@ldelossa/pi-ide 0.2.3 → 0.2.4

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.
Files changed (2) hide show
  1. package/index.ts +5 -1
  2. package/package.json +1 -1
package/index.ts CHANGED
@@ -377,7 +377,11 @@ function alignSuggestion(block: string, params: SuggestionParams): string | null
377
377
  const prefix = currentLinePrefix(params);
378
378
  let suggestion = block.replace(/\r\n/g, "\n").replace(/^\n+/, "").replace(/\n+$/, "");
379
379
  if (suggestion === "") return null;
380
- if (prefix.trim() !== "" && suggestion.startsWith(prefix)) suggestion = suggestion.slice(prefix.length);
380
+ // The editor inserts the returned text at the cursor. When the cursor is
381
+ // already after indentation on an otherwise-empty line, a full-line model
382
+ // response often repeats that indentation; strip only that first-line prefix
383
+ // so the editor's existing indent is not doubled.
384
+ if (prefix !== "" && suggestion.startsWith(prefix)) suggestion = suggestion.slice(prefix.length);
381
385
  if (params.cursorInComment) return normalizeCommentSuggestion(suggestion, prefix);
382
386
  if (prefix.trim() !== "") {
383
387
  const firstLine = suggestion.split("\n", 1)[0] ?? "";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ldelossa/pi-ide",
3
- "version": "0.2.3",
3
+ "version": "0.2.4",
4
4
  "description": "Pi extension that connects to a running editor (Neovim today, more later) over a local WebSocket. Adds ambient editor context to the agent and routes write/edit tool calls through interactive diffs in the editor.",
5
5
  "keywords": ["pi-package", "pi", "ide", "neovim"],
6
6
  "files": [