Skip to content

fix(completion): avoid double indentation in inline ghost text - #176

Merged
sanskarIN merged 3 commits into
mainfrom
fix/inline-ghost-text-indent-echo-20261030
Oct 30, 2026
Merged

sanskarIN merged 3 commits into
mainfrom
fix/inline-ghost-text-indent-echo-20261030

Conversation

@sanskarIN

Copy link
Copy Markdown
Owner

User-facing issue

When the cursor already sits after indentation on an otherwise blank code line, a local model can emit the same indentation at the beginning of its continuation. LineLoom was not recognizing whitespace-only prefix echoes, so accepting the suggestion doubled indentation (notably in Python).

Fix

  • Remove at most the exact spaces/tabs already present on the current editor line when the generated insertion starts with that same indentation.
  • Preserve further model-generated indentation for deeper nested code and never strip a generated line's indentation if the cursor line already contains code or the generation starts with an actual newline.
  • Add unit regression tests for Python blocks, tabs/mixed whitespace, nested indentation, non-blank cursor lines, and final accepted document text.

Scope and validation

  • Pure completion postprocessing: no new network request, source upload, settings change or model download.
  • Existing privacy and cancellation checks remain unchanged.
  • No trained first-party weights or real Ollama editor-quality measurement implied; focused source+synthetic tests and CI are required before merge.
  • No new VSIX/marketplace release or publisher migration requested.

@sanskarIN
sanskarIN merged commit e0abe10 into main Oct 30, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant