[QScintilla] Fw: setAutoIndentStyle doesn't work

Matic Kukovec kukovecmatic at hotmail.com
Sun May 14 23:24:01 BST 2017


> On 14 May 2017, at 11:26 am, kristof.mulier at telenet.be wrote:
> >
> > Dear QScintilla users,
> >
> > Automatic indentation is a very nice feature offered by QScintilla. When inserting a new line, automatic indentation pushes the cursor to the same indentation level as the previous one. You have two options to switch on this feature: (1) call the function setAutoIndent(True) on the QsciScintilla editor or (2) call the function setAutoIndentStyle(..) on the lexer.
> >
> > The first option works. The second doesn't. For full details on the problem, please take a look at the following StackOverflow question:
> >
> > http://stackoverflow.com/questions/43962669/setautoindentstyle-on-the-qscintilla-lexer-doesnt-work
> >
> > Do you know the answer?
>
> You have to implement the various block method (blockStart(), blockEnd() etc).
>
> Phil


Hey Phil,


Tried implementing blockStart() and blockEnd(), but it throws a TypeError if using for example:

<https://www.riverbankcomputing.com/mailman/listinfo/qscintilla>
def blockStart(self):
        return "{"

def blockEnd(self):
        return "}"
With a bit of trial&error I found that the methods need to return a tuple of (bytes, int). Why?

Thanks,
Matic
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/qscintilla/attachments/20170514/c6211fa5/attachment.html>


More information about the QScintilla mailing list