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(sidebar): apply windows.wrap setting to the selected code and avante input #789

Merged
merged 1 commit into from
Nov 23, 2024

Conversation

brewinski
Copy link
Contributor

Small change to apply the wrap setting to the selected code and avante input windows in the sidebar.

If the preference is to allow the user to configure each window individually, I can implement this by extending the window configuration object to include a input and selected code wrap setting.

As always, let me know if there are any suggestions or improvements that can be made.

Before:
image

After:
image

Copy link
Collaborator

@aarnphm aarnphm left a comment

Choose a reason for hiding this comment

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

you might also have to handle how to handle the extmark for confirm correctly with wrap (the reason we didn't handle it earlier was that this was a bit too hard fwiw, or idk how to do it).

@brewinski
Copy link
Contributor Author

Thanks for the feedback @aarnphm. Do you mean handling the position of <CR>: submit hint text? If so, I'll see what I can do about the position of this.

@aarnphm
Copy link
Collaborator

aarnphm commented Nov 4, 2024

yeah the <CR>: submit

@brewinski
Copy link
Contributor Author

@aarnphm I've tried a couple of different options. As you mentioned it's fairly difficult to get it to work well in all situations.

The simplest option is to move the hint into the header and have the header update based on the user's mode and input. e.t.c. The main drawback of this is that it increases the width of the header.
image

Alternatively, using extmark / virtual text to place the hint text at the end of the line of the current cursor can work. A drawback is that the hint will overflow the window when the text is close to the end of the line until the line wraps. The benefit being that the text should never overlap the users input.

There's an option where we calculate the wrap position however I haven't tried this yet.

If you have any other ideas or have a preference for one of these options happy to hear it and please let me know.

@yetone yetone merged commit d14b229 into yetone:main Nov 23, 2024
2 checks passed
@brewinski brewinski deleted the bugfix/window-wrap branch December 17, 2024 06:35
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.

3 participants