Skip to content

Commit a4e2128

Browse files
authored
Add support for highlighting closing parens, brackets, and braces at the REPL (#1074)
This is a very helpful feature I noticed on the Clojure REPL and prompt-toolkit supported it natively, so it was a no brainer to add.
1 parent e3a3bf0 commit a4e2128

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

77
## [Unreleased]
8-
98
### Added
109
* Added functions to `basilisp.test` for using and combining test fixtures (#980)
1110
* Added the `importing-resolve` function for dynamically importing and resolving a Python name (#1065, #1070)
11+
* Added support for highlighting matching parens, brackets, and braces at the REPL (#1074)
1212

1313
### Fixed
1414
* Fix a bug where the reader was double counting the CRLF newline seq in metadata (#1063)

src/basilisp/prompt.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
from prompt_toolkit.history import FileHistory
1515
from prompt_toolkit.key_binding import KeyBindings
1616
from prompt_toolkit.key_binding.key_processor import KeyPressEvent
17+
from prompt_toolkit.layout.processors import HighlightMatchingBracketProcessor
1718

1819
from basilisp.lang import reader as reader
1920
from basilisp.lang import runtime as runtime
@@ -77,6 +78,7 @@ def __init__(self):
7778
key_bindings=self._get_key_bindings(),
7879
lexer=self._prompt_toolkit_lexer,
7980
multiline=True,
81+
input_processors=[HighlightMatchingBracketProcessor(chars="[](){}")],
8082
**self._style_settings,
8183
)
8284

0 commit comments

Comments
 (0)