Skip to content

Conversation

@slg95
Copy link
Contributor

@slg95 slg95 commented Aug 11, 2025

Description

block_locator was trimming empty lines from the beginning and end of files. This is more impactful when trying to append to a file that ends in a newline, which would include any text file adhering to the POSIX standard (ending in a newline).

Sometimes LLMs include the trailing newline in the search block, which causes the bound check to short-circuit in SearchEngine:_evaluate_position().

If you want to try to reproduce the Issue, I would suggest creating a simple file such as:

Hello World

then telling an LLM to append something to the end of the file. I had this action fail with Claude Sonnet.

  • I've read the contributing guidelines and have adhered to them in this PR
  • I've updated the README and/or relevant docs pages
  • I've run make test to ensure all tests pass
  • I've run make format to format the code
  • I've run make docs to update the vimdoc pages

block_locator was trimming empty lines from the beginning and end of files. This is more impactful when trying to append to a file that ends in a newline, which would include any text file adhering to the POSIX standard (ending in a newline).

Sometimes LLMs include the trailing newline in the search block, which causes the bound check to short-circuit in SearchEngine:_evaluate_position().
@ravitemer
Copy link
Owner

Thanks for raising this. This should be fixed now.

@ravitemer ravitemer closed this Aug 21, 2025
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.

2 participants