mirror of
https://github.com/zed-industries/zed.git
synced 2024-12-28 15:44:20 +03:00
Never show whitespace-only Copilot suggestions (#7623)
Fixes https://github.com/zed-industries/zed/issues/7582 Release Notes: - Fixed a bug that caused Copilot to suggest leading indentation even after the user accepted/discarded a suggestion ([#7582](https://github.com/zed-industries/zed/issues/7582)) Co-authored-by: Thorsten Ball <thorsten@zed.dev> Co-authored-by: Bennet <bennetbo@gmx.de>
This commit is contained in:
parent
ad97e447f5
commit
93ceb89c0c
@ -1222,7 +1222,12 @@ impl CopilotState {
|
||||
if completion_range.is_empty()
|
||||
&& completion_range.start == cursor.text_anchor.to_offset(&completion_buffer)
|
||||
{
|
||||
Some(&completion.text[prefix_len..completion.text.len() - suffix_len])
|
||||
let completion_text = &completion.text[prefix_len..completion.text.len() - suffix_len];
|
||||
if completion_text.trim().is_empty() {
|
||||
None
|
||||
} else {
|
||||
Some(completion_text)
|
||||
}
|
||||
} else {
|
||||
None
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user