From 3997d6c93c1487a124334a5afac498199d43cb64 Mon Sep 17 00:00:00 2001 From: WormHeamer Date: Wed, 31 Dec 2025 04:14:24 -0500 Subject: % to find matching bracket --- main.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'main.c') diff --git a/main.c b/main.c index 626e066..ee25eac 100644 --- a/main.c +++ b/main.c @@ -144,6 +144,8 @@ static inline u32 bracket_opp(u32 c) { case ']': return '['; case '(': return ')'; case ')': return '('; + case '<': return '>'; + case '>': return '<'; default: return c; } @@ -151,8 +153,8 @@ static inline u32 bracket_opp(u32 c) { static inline int bracket_dir(u32 c) { switch (c) { - case '{': case '[': case '(': return 1; - case '}': case ']': case ')': return -1; + case '{': case '[': case '(': case '<': return 1; + case '}': case ']': case ')': case '>': return -1; default: return 0; } @@ -500,6 +502,9 @@ loop: case ']': l = next_func(l); break; + case '%': + l = match_bracket(l); + break; case KEY_PGUP: for (u32 i = 0; i < LINES; i += 3) l = prev_line(l); break; -- cgit v1.2.3