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 on region discards last newline #552

Closed
1 task done
ekenberg opened this issue Jan 7, 2025 · 2 comments
Closed
1 task done

gptel-rewrite on region discards last newline #552

ekenberg opened this issue Jan 7, 2025 · 2 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 on a region discards last newline

Backend

None

Steps to Reproduce

With this code:

# line before region
for i in range(1, 10 + 1):
    print(i)
# line after region

mark (region) the two lines between the comments, including end-of-line on second line
run gptel-rewrite and tell it to simplify the code
accept the rewrite and the result will look something like this (the last comment is moved to previous line because missing newline in gptel-rewrite result)

# line before region
for i in range(1, 11):
    print(i)# line after region

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
@karthink
Copy link
Owner

I can't reproduce this. Which backend/model did you use here?

@ekenberg
Copy link
Author

I can't reproduce this. Which backend/model did you use here?

Thank you for responding.

I am using Claude 3.5 Sonnet 2024-10-22. But weirdly enough, I cannot reproduce it either, despite going back and forth between gptel-versions and other potential changes since reporting. I did spend quite a bit of time testing before reporting, so the issue was definitely there. But now it's gone.

I am closing this now. If the issue resurfaces, I shall try to provide more details on the data sent to and from the backend.

Thanks a lot for your fine work on gptel!

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

2 participants