From 0028507a3d326add5d45d20cfe750ef964d9b3f0 Mon Sep 17 00:00:00 2001 From: Matthijs Kooijman Date: Wed, 1 Jul 2009 16:32:07 +0200 Subject: [PATCH] Only allow a word to start with a-z in pret-lam. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This prevents seeing a λ or other non a-z (but letter characters according to the %a character class) as the start of a word. --- pret-lam.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pret-lam.lua b/pret-lam.lua index c05f987..cf50e87 100644 --- a/pret-lam.lua +++ b/pret-lam.lua @@ -62,7 +62,9 @@ end -- Take a single word from str, if posible. Returns the rest of the string and -- the word taken. function buffers.visualizers.lam.take_word(str) - res, newstr = utf.match(str, "^(%a[%a%d_]+)(.*)") + -- A word must always start with a-z (in particular, λ is not a valid + -- start of a word). + res, newstr = utf.match(str, "^([a-z][%a%d_]+)(.*)") return res, newstr or str end -- 2.30.2