summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWormHeamer2026-01-01 03:36:20 -0500
committerWormHeamer2026-01-01 03:36:20 -0500
commit93752fb1107536a5e1dff26767b80e045ad220e9 (patch)
tree33ce44fb2e975c80d849e85945d473483fe53b04
parent0db238251c580fa07e16e9063d96f2b074290941 (diff)
don't search for matching bracket if not actually on that bracket
-rw-r--r--main.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/main.c b/main.c
index 7edb770..cf6c18c 100644
--- a/main.c
+++ b/main.c
@@ -201,6 +201,7 @@ static inline int bracket_dir(u32 c) {
int match_bracket(TxtLoc l, TxtLoc *out, u32 c) {
u32 depth = 1;
u32 o = bracket_opp(c);
+ if (txt_chr(l) != c) return 0;
int dir = bracket_dir(c);
if (dir < 0) {
while (!at_start(l) && depth > 0) {