[textadept] TeX lexers

From: Robert <ro....at.web.de>
Date: Fri, 17 Jun 2011 11:55:57 +0200


I've used a combined tex lexer that highlighted both context and latex
environments. Now with folding added, and highlighting parts,
sections, etc. this becomes confusing so I created separate lexers
[1-3]. To avoid duplication I reused TeX definitions by loading
the tex lexer explicitly:
local tex = require('tex')
_rules = {
  { 'whitespace', tex.ws },
  { 'comment', tex.comment },
  { 'environment', environment }, -- different environment

Does this make sense? Is there a way to use embedded lexers for this purpose?

Differences to the previous versions is the highlighting of all
\begin-\end-blocks and \chapters, \sections, etc.

About folding, in plain TeX and Context I have
\begintt ... \endtt or \starttyping ... \endtyping blocks. It is not
possible to handle these with the simple folding, correct?
They can only match text, so I have to write a function?


[1] https://github.com/rgieseke/textadept-lexers/blob/master/tex.lua
[2] https://github.com/rgieseke/textadept-lexers/blob/master/latex.lua
[3] https://github.com/rgieseke/textadept-lexers/blob/master/contex.lua
Received on Fri 17 Jun 2011 - 05:55:57 EDT

This archive was generated by hypermail 2.2.0 : Thu 08 Mar 2012 - 12:11:12 EST