Hi Paul,
Le 10/10/2017 à 08:35, Paul K a écrit :
> Hi Neil,
>
> I'm trying to use ANSI escapes that were added back in 3.6.1 and can't
> figure out why they are not working in my case. I'm using 3.6.6 version
> (as part of wxwidgets) and since the escape handling was added in 3.6.1
> and updated in 3.6.3, I'd expect the following fragment to work:
>
> e:SetText("some text \027[1;31mXYZ\027[0m and more")
> e:SetLexer(wxstc.wxSTC_LEX_ERRORLIST)
> e:SetProperty("lexer.errorlist.escape.sequences","1")
>
> However, the editor only shows the text as is: `some text [1;31mXYZ [0m
> and more` (with ESC marked in bold as a special character).
You're not using the correct escape sequence. "\027" is the octal
representation of decimal 23 or hex 0x17, which is ASCII ETB, not ESC.
ESC is octal 33, decimal 27 or hex 0x1B, so write it either as "\033" or
"\x1B" (I guess the octal version is more common, so I'd go for "\033").
Regards,
Colomban