From 6493f3173bbe36cdcd51ea6fc607966e10373944 Mon Sep 17 00:00:00 2001 From: Matthijs Kooijman Date: Wed, 10 Jun 2009 18:02:53 +0200 Subject: [PATCH 1/1] Prevent pret-lam from matching subwords. --- pret-lam.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pret-lam.lua b/pret-lam.lua index 7bb1f8a..a87137c 100644 --- a/pret-lam.lua +++ b/pret-lam.lua @@ -56,8 +56,10 @@ function buffers.visualizers.lam.flush_line(str,nested) end end if not found then - result[#result+1] = utf.sub(str, 1, 1) - str = utf.sub(str, 2) + -- Take a full word, or a single character. Taking a full word is + -- to prevent matching "in" in "bind" , for example. + result[#result+1] = utf.match(str, "^%a+") or utf.sub(str, 1, 1) + str = utf.sub(str, utf.len(result[#result]) + 1) end end state = finish(state, result) -- 2.30.2