From fa06aff8754a2c8064d52edb6af8d6cf8b7a1fc1 Mon Sep 17 00:00:00 2001
From: Přemysl Janouch
Date: Tue, 23 May 2017 18:08:00 +0200
Subject: repl: highlight matching parenthesis
---
repl.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/repl.c b/repl.c
index b41f241..bc4d7e8 100644
--- a/repl.c
+++ b/repl.c
@@ -42,6 +42,12 @@ run (struct context *ctx, struct item *program) {
}
}
+static int
+init_readline (void) {
+ rl_variable_bind ("blink-matching-paren", "on");
+ return 0;
+}
+
int
main (int argc, char *argv[]) {
(void) argc;
@@ -54,6 +60,7 @@ main (int argc, char *argv[]) {
using_history ();
const char *slash = strrchr (argv[0], '/');
rl_readline_name = slash ? ++slash : argv[0];
+ rl_startup_hook = init_readline;
char *line;
while ((line = readline ("> "))) {
--
cgit v1.2.3-70-g09d2