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

Fix empty space on assistant responses line when 'virtualedit=all' is set. #148

Conversation

juodumas
Copy link
Contributor

@juodumas juodumas commented Mar 4, 2025

This make copying easier.

Before this change the AI would respond like this:

>>> assistant

 Hi

Now it responds like this:

>>> assistant

Hi

@juodumas
Copy link
Contributor Author

juodumas commented Mar 7, 2025

If you decide to merge #151, then this PR is not needed.

@madox2
Copy link
Owner

madox2 commented Mar 7, 2025

Before this change the AI would respond like this

I cannot reproduce it, in my environments there is never a space before the response text. Even from the change you made to the code I don't get what would be a difference.

Could you describe more your environment, configuration and steps how you can reproduce it?

@juodumas
Copy link
Contributor Author

juodumas commented Mar 10, 2025

Looks like it's because of set virtualedit=all.
Any ideas how to make it work correctly with this setting?
It changes the behaviour of a.
I use it to freely move my cursor and for visual block edits.

@madox2
Copy link
Owner

madox2 commented Mar 12, 2025

I see. This would however solve the issue just for the chat, not for :AI, :AIE.

I did some quick testing and this combination seems to be working fine for any mode:

  • A for :AI, :AIC
  • a for :AIE

@juodumas juodumas force-pushed the do-not-add-space-on-each-line-of-assistant-response branch from 467e001 to d626067 Compare March 14, 2025 10:02
@juodumas juodumas changed the title Do not add a space on each line of assistant response in the chat window Fix empty space on assistant responses line when 'virtualedit=all' is set. Mar 14, 2025
\ "command_type": 'complete',
\ "command_type": 'edit',
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@madox2 this change is unrelated to this PR, but it's useful for my change and looks like an omission after the role changes?

@juodumas
Copy link
Contributor Author

Thank you for testing!
I have force pushed an update, now :AI, :AIE, :AIChat all seem to work as expected with virtualedit= & virtualedit=all.
I can fix the tests if you agree with the changes.

@madox2
Copy link
Owner

madox2 commented Mar 14, 2025

Looks good, let me fix tests for you

@madox2 madox2 merged commit 622b66c into madox2:main Mar 14, 2025
1 check failed
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