Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gptel-rewrite diff fails in modified buffer #553

Open
1 task done
ekenberg opened this issue Jan 7, 2025 · 0 comments
Open
1 task done

gptel-rewrite diff fails in modified buffer #553

ekenberg opened this issue Jan 7, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@ekenberg
Copy link

ekenberg commented Jan 7, 2025

Please update gptel first -- errors are often fixed by the time they're reported.

  • I have updated gptel to the latest commit and tested that the issue still exists

Bug Description

gptel-rewrite diff fails to show a correct diff when buffer is modified since last saved

Note: ediff works as expected

Backend

None

Steps to Reproduce

Put this code in a .py file and save it:

for i in range(1, 11):
    print(i)

Change the code to this but do not save the buffer:

for i in range(1, 10 + 1):
    print(i)

Run gptel-rewrite on the code, tell it to simplify and (hopefully) get this suggested result:

for i in range(1, 11):
    print(i)

Now, run diff (RET d or C-c C-d) and the result shows no changes (except for a missing newline which is issue #552)

diff -u --label /home/johan/tmp/gptel-test.py --label \#\<buffer\ \*gptel-diff\*\> /home/johan/tmp/gptel-test.py /tmp/buffer-content-mdiIZ5
--- /home/johan/tmp/gptel-test.py
+++ #<buffer *gptel-diff*>
@@ -3,5 +3,4 @@
 
 for i in range(1, 11):
     print(i)
-
 # more code

Diff finished.  Tue Jan  7 11:43:08 2025

Note: ediff works as expected

Additional Context

Emacs version: "GNU Emacs 29.3 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.33, cairo version 1.16.0) of 2024-05-03"
gptel version: 20250107.34

Backtrace

No response

Log Information

No response

@ekenberg ekenberg added the bug Something isn't working label Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant