[QScintilla] QSciLexer blockStart & blockEnd return type error

Matic Kukovec kukovecmatic at hotmail.com
Sun Mar 24 13:28:49 GMT 2019


Excellent, thanks Phil.
________________________________
From: Phil Thompson <phil at riverbankcomputing.com>
Sent: Sunday, March 24, 2019 12:37 PM
To: Matic Kukovec
Cc: QScintilla
Subject: Re: [QScintilla] QSciLexer blockStart & blockEnd return type error

On 24 Mar 2019, at 11:15 am, Matic Kukovec <kukovecmatic at hotmail.com> wrote:
>
> Hi Phil,
>
> I have these two methods in a QsciLexerCustom:
>     def blockStart(self, style=0):
>         return data.QByteArray(1, "{")
>
>     def blockEnd(self, style=0):
>         return data.QByteArray(1, "}")
>
> But on pressing Enter inside the editor always throws: TypeError: invalid result from MyLexer.blockStart()
> I also tried return bytes("{", encoding="utf-8") and return "{", but those also throw the same error.
> This is on PyQt5.11.3 / QScintilla2.10.8.
>
> Am I missing something?

help(QsciLexer.blockStart)

Phil
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/qscintilla/attachments/20190324/ae753491/attachment.html>


More information about the QScintilla mailing list