diff options
author | Hans Hagen <pragma@wxs.nl> | 2017-04-16 13:20:40 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg42.2a@gmail.com> | 2017-04-16 13:20:40 +0200 |
commit | 218228536ed709be8ab2dde4a00dc27249ceed8a (patch) | |
tree | 71b331e3d99ebd89fefcc1cb369d233c5c7fbdc1 /context/data/scite/context/lexers/scite-context-lexer-tex.lua | |
parent | ea2466fe69bd082d379e95e1567f3de0b76de243 (diff) | |
download | context-218228536ed709be8ab2dde4a00dc27249ceed8a.tar.gz |
2017-04-16 12:47:00
Diffstat (limited to 'context/data/scite/context/lexers/scite-context-lexer-tex.lua')
-rw-r--r-- | context/data/scite/context/lexers/scite-context-lexer-tex.lua | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/context/data/scite/context/lexers/scite-context-lexer-tex.lua b/context/data/scite/context/lexers/scite-context-lexer-tex.lua index 3f3673347..4787263a3 100644 --- a/context/data/scite/context/lexers/scite-context-lexer-tex.lua +++ b/context/data/scite/context/lexers/scite-context-lexer-tex.lua @@ -144,17 +144,20 @@ local validminimum = 3 -- fails (empty loop message) ... latest lpeg issue? +-- todo: Make sure we only do this at the beginning .. a pitty that we +-- can't store a state .. now is done too often. + local knownpreamble = Cmt(P("% "), function(input,i,_) -- todo : utfbomb, was #P("% ") if i < 10 then validwords, validminimum = false, 3 - local s, e, word = find(input,"^(.+)[\n\r]",i) -- combine with match + local s, e, word = find(input,"^(.-)[\n\r]",i) -- combine with match if word then - local interface = match(word,"interface=([a-z]+)") + local interface = match(word,"interface=([a-z][a-z]+)") if interface and #interface == 2 then inform("enabling context user interface '%s'",interface) currentcommands = commands[interface] or commands.en or { } end - local language = match(word,"language=([a-z]+)") + local language = match(word,"language=([a-z][a-z]+)") validwords, validminimum = setwordlist(language) end end |