aider/aider
Paul Gauthier 2a0761b0ce aider: Added MarkdownLexer to highlight user input with markdown syntax.
# Context:
USER: have `prompt_toolkit` highlight the user input with a markdown lexer
ASSISTANT: To highlight the user input with a markdown lexer, we need to modify the `aider/io.py` file. We will import the `MarkdownLexer` from `pygments.lexers.markup` and use it as the lexer for the `PromptSession`.

Here's the change you need to make:

```python
aider/io.py
<<<<<<< ORIGINAL
from pygments.lexers import guess_lexer_for_filename
=======
from pygments.lexers import guess_lexer_for_filename, MarkdownLexer
>>>>>>> UPDATED
```

And update the `PromptSession` instantiation in the `get_input` method:

```python
aider/io.py
<<<<<<< ORIGINAL
            session_kwargs = {
                "message": show,
                "completer": completer_instance,
                "reserve_space_for_menu": 4,
                "complete_style": CompleteStyle.MULTI_COLUMN,
                "input": self.input,
                "output": self.output,
            }
=======
            session_kwargs = {
                "message": show,
                "completer": completer_instance,
                "reserve_space_for_menu": 4,
                "complete_style": CompleteStyle.MULTI_COLUMN,
                "input": self.input,
                "output": self.output,
                "lexer": MarkdownLexer(),
            }
>>>>>>> UPDATED
```

These changes will import the `MarkdownLexer` and use it for the `PromptSession`, which will highlight the user input with markdown syntax.
2023-05-29 11:42:19 -07:00
..
__init__.py initial 2023-05-09 11:00:32 -07:00
coder.py isort 2023-05-28 22:47:38 -07:00
commands.py isort 2023-05-28 22:47:38 -07:00
dump.py isort 2023-05-28 22:47:38 -07:00
io.py aider: Added MarkdownLexer to highlight user input with markdown syntax. 2023-05-29 11:42:19 -07:00
main.py isort 2023-05-28 22:47:38 -07:00
prompts.py Fixed /run output to log 2023-05-28 11:20:08 -07:00
repomap.py isort 2023-05-28 22:47:38 -07:00
utils.py fixed corner case bugs in find_original_update_blocks 2023-05-29 07:12:57 -07:00