Folding, lexer.lua

From: Tymur Gubayev <tymur.guba....at.gmail.com>
Date: Thu, 18 Aug 2011 12:13:11 -0700 (PDT)

Hi list,

 i will try to improve folding in Textadept (like implementing
highlight.indentation.guides), but before i start i have some
questions.

First of all, i don't understand how to debug it... I should use
`_G.print`, but it gives no output for me. Is the reason i need a `-
DDEBUG` version of the executable's/library's? If so, can someone
please compile it for me - i have windows here, and i'm unable to
compile Texadept myself...

Another question is, is there any reason to use
     text:sub(p - 1, p - 1):find('^[^\n]$')
instead of
     text:sub(p - 1, p - 1)~='\n'
?

And last, but not least, a suggestion for themes:
I currently use in `themes\dark\view.lua` following code:

-------------------------------------------------------------------
-- Fold Margin Markers.
local function set_fold_mark(marknum, mark, fore, back)
        buffer:marker_define(marknum, mark)
        buffer:marker_set_fore(marknum, fore or 0xFFFFFF)
        buffer:marker_set_back(marknum, back or 0x000000)
end--func set_fold_mark
local mark_fore = 0xFFFFFF -- white
local mark_back = 0x000000 -- black
set_fold_mark(c.SC_MARKNUM_FOLDEROPEN, c.SC_MARK_BOXMINUS, mark_fore,
mark_back)
set_fold_mark(c.SC_MARKNUM_FOLDER, c.SC_MARK_BOXPLUS, mark_fore,
mark_back)
set_fold_mark(c.SC_MARKNUM_FOLDERSUB, c.SC_MARK_VLINE, mark_fore,
mark_back)
set_fold_mark(c.SC_MARKNUM_FOLDERTAIL, c.SC_MARK_LCORNER, mark_fore,
mark_back)
set_fold_mark(c.SC_MARKNUM_FOLDEREND, c.SC_MARK_BOXPLUSCONNECTED,
mark_fore, mark_back)
set_fold_mark(c.SC_MARKNUM_FOLDEROPENMID, c.SC_MARK_BOXMINUSCONNECTED,
mark_fore, mark_back)
set_fold_mark(c.SC_MARKNUM_FOLDERMIDTAIL, c.SC_MARK_TCORNER,
mark_fore, mark_back)
-----------------------------------------------------------

it makes folding symbols be vertical lines, with boxed + or - (the
boxes are too small with default margin width, so i use it with
Received on Thu 18 Aug 2011 - 15:13:11 EDT

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