mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-31 01:35:00 +00:00
fix: update _get_style method to conditionally add completion menu styles based on non-null values
This commit is contained in:
parent
ede3cbb372
commit
537f5a1f98
1 changed files with 17 additions and 11 deletions
28
aider/io.py
28
aider/io.py
|
@ -264,17 +264,23 @@ class InputOutput:
|
|||
}
|
||||
)
|
||||
|
||||
style_dict.update(
|
||||
{
|
||||
"completion-menu": (
|
||||
f"bg:{self.completion_menu_bg_color} {self.completion_menu_color}"
|
||||
),
|
||||
"completion-menu.completion.current": (
|
||||
f"bg:{self.completion_menu_current_bg_color} "
|
||||
f"{self.completion_menu_current_color}"
|
||||
),
|
||||
}
|
||||
)
|
||||
# Conditionally add 'completion-menu' style
|
||||
completion_menu_style = []
|
||||
if self.completion_menu_bg_color:
|
||||
completion_menu_style.append(f"bg:{self.completion_menu_bg_color}")
|
||||
if self.completion_menu_color:
|
||||
completion_menu_style.append(self.completion_menu_color)
|
||||
if completion_menu_style:
|
||||
style_dict["completion-menu"] = " ".join(completion_menu_style)
|
||||
|
||||
# Conditionally add 'completion-menu.completion.current' style
|
||||
completion_menu_current_style = []
|
||||
if self.completion_menu_current_bg_color:
|
||||
completion_menu_current_style.append(f"bg:{self.completion_menu_current_bg_color}")
|
||||
if self.completion_menu_current_color:
|
||||
completion_menu_current_style.append(self.completion_menu_current_color)
|
||||
if completion_menu_current_style:
|
||||
style_dict["completion-menu.completion.current"] = " ".join(completion_menu_current_style)
|
||||
|
||||
return Style.from_dict(style_dict)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue