From 3751586e1fbf044fa798737e9c59a0235c5aaee7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Sat, 25 Feb 2017 20:48:51 +0100 Subject: lexers: sync with scintillua changeset 594 rev 6e29a8d2a783 Stuff which was left out / our local changes include: - lexer.lua: different loading mechanism and style handling - ansi_c.lua: for now we keep the separate token definitions with references to the respective standards. This should highlight file names after #include directives. It will also treat simple, non-nested occurrences of #if 0 ... #endif as a comment. - pkgbuild.lua: the arch specific fields have been kept - all scintilla $(style variables) have been replaced --- lua/lexers/lexer.lua | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'lua/lexers/lexer.lua') diff --git a/lua/lexers/lexer.lua b/lua/lexers/lexer.lua index d159f70..e7d749f 100644 --- a/lua/lexers/lexer.lua +++ b/lua/lexers/lexer.lua @@ -1510,6 +1510,20 @@ function M.embed_lexer(parent, child, start_rule, end_rule) tokenstyles[token] = style end end + -- Add child fold symbols. + if not parent._foldsymbols then parent._foldsymbols = {} end + if child._foldsymbols then + for token, symbols in pairs(child._foldsymbols) do + if not parent._foldsymbols[token] then parent._foldsymbols[token] = {} end + for k, v in pairs(symbols) do + if type(k) == 'number' then + parent._foldsymbols[token][#parent._foldsymbols[token] + 1] = v + elseif not parent._foldsymbols[token][k] then + parent._foldsymbols[token][k] = v + end + end + end + end child._lexer = parent -- use parent's tokens if child is embedding itself parent_lexer = parent -- use parent's tokens if the calling lexer is a proxy end -- cgit v1.2.3