Open will-lynas opened 2 months ago
this is actually intended, otherwise the LLM won't generate correct code.
We need to preserve indentation somehow. Maybe for rendering on sidebar we can skip indentation on view 🤔
Feel free to propose something here.
Yeah that's what I mean. Keep the original response but render a trimmed one.
feel free to contribute. Check sidebar.lua for this.
This is harder than I initially thought because of the token streaming.
And the fact that the code snippets are extracted directly from the content that is rendered in the sidebar: https://github.com/yetone/avante.nvim/blob/713cb403d0e3c3b9b8b9cacb1ca0ff5d6fc35a7d/lua/avante/sidebar.lua#L316
I guess a really hacky way to do this is:
But as a more general solution, what about this:
This way, we are free to change the formatting of the code in the sidebar without it affecting the actual diff.
I'm not sure how to handle partially complete code blocks. I can think of either:
What are your thoughts?
When working with deeply nested code, the sidebar view is not easy to read. I think it would be better if the code was left-trimmed so that there are no columns of pure whitespace.