Re: [textadept] Folding, lexer.lua

From: mitchell <c....at.caladbolg.net>
Date: Thu, 18 Aug 2011 15:31:40 -0400 (Eastern Daylight Time)

Hi Tymur,

On Thu, 18 Aug 2011, Tymur Gubayev wrote:

> 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...

If you open your DOS prompt in ta's directory, you can type:

c:\textadept>textadept.exe > log.txt 2>&1

and it should log all print statements to log.txt.

> 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'
> ?

No. Originally I wanted to be able to include \r with \n, but that proved
unsuccessful and I never changed the string to reflect that; I will do so,
thanks.

mitchell

> 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
> `buffer.margin_width_n[2] = 16`)
>
> --
> You received this message because you are subscribed to the Google Groups "textadept" group.
> To post to this group, send email to textadept.at.googlegroups.com.
> To unsubscribe from this group, send email to textadept+unsubscribe.at.googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/textadept?hl=en.
>
>

mitchell
Received on Thu 18 Aug 2011 - 15:31:40 EDT

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