mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-01 10:14:59 +00:00
style: Format code according to linter rules
This commit is contained in:
parent
7316635aba
commit
ac4e4959eb
1 changed files with 4 additions and 6 deletions
|
@ -5,7 +5,7 @@ import time
|
||||||
|
|
||||||
from rich.console import Console
|
from rich.console import Console
|
||||||
from rich.live import Live
|
from rich.live import Live
|
||||||
from rich.markdown import Markdown, CodeBlock
|
from rich.markdown import CodeBlock, Markdown
|
||||||
from rich.syntax import Syntax
|
from rich.syntax import Syntax
|
||||||
from rich.text import Text
|
from rich.text import Text
|
||||||
|
|
||||||
|
@ -49,18 +49,16 @@ The end.
|
||||||
|
|
||||||
class NoInsetCodeBlock(CodeBlock):
|
class NoInsetCodeBlock(CodeBlock):
|
||||||
"""A code block with syntax highlighting and no padding."""
|
"""A code block with syntax highlighting and no padding."""
|
||||||
|
|
||||||
def __rich_console__(self, console, options):
|
def __rich_console__(self, console, options):
|
||||||
code = str(self.text).rstrip()
|
code = str(self.text).rstrip()
|
||||||
syntax = Syntax(
|
syntax = Syntax(code, self.lexer_name, theme=self.theme, word_wrap=True, padding=0)
|
||||||
code, self.lexer_name, theme=self.theme, word_wrap=True, padding=0
|
|
||||||
)
|
|
||||||
yield syntax
|
yield syntax
|
||||||
|
|
||||||
|
|
||||||
class NoInsetMarkdown(Markdown):
|
class NoInsetMarkdown(Markdown):
|
||||||
"""Markdown with code blocks that have no padding."""
|
"""Markdown with code blocks that have no padding."""
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def make_elements(cls):
|
def make_elements(cls):
|
||||||
elements = super().make_elements()
|
elements = super().make_elements()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue