Skip to content

Two edits to the same file are broken, if the first edit changes line numbers #6

Closed

Description

@valyagolev

Basically if there's two edits to the same file, and the first edit changes a number of lines (e.g. changes 3 lines into 2), the second edit doesn't seem to take this into account, and applies the changes wrongly.

P.S. What an amazing tool. It's incredible. Thank you!

Activity

  1. valyagolev commented on May 23, 2023

    @valyagolev
    Author

    actually, maybe the problem is that my autoformatter formatted a file after commit or something like this, which broke the editing. maybe the tool could automatically refresh the files

  2. paul-gauthier commented on May 24, 2023

    @paul-gauthier
    Collaborator

    Thanks for trying out aider and for reporting the issue.

    I haven't seen a problem like you are describing. It might help if you looked in .aider.chat.history.md and pulled out the part of the conversation where you had an issue. But I understand if you'd rather not share that data.

    The tool does watch for edits to the files and always ensures that it passes the latest file contents to GPT.

    Any chance you were changing the file in your editor at the same time GPT was typing a response back at you? There is a possible race condition if you change the file after GPT starts responding, but before it finishes sending you all its edits.

  3. valyagolev commented on May 24, 2023

    @valyagolev
    Author

    sounds unlikely, but well, maybe? i'll try to reproduce / explore the logs if this happens again

  4. paul-gauthier commented on May 29, 2023

    @paul-gauthier
    Collaborator

    I'm going to close this issue for now. Please feel free to re-open or file a fresh issue if you're able to reproduce the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions