<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Arial,Helvetica,sans-serif;" dir="ltr">
<p><br>
</p>
<div style="color: rgb(0, 0, 0);">
<div>
<div id="divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:#000000; font-family:Calibri,Arial,Helvetica,sans-serif">
> On 14 May 2017, at 11:26 am, kristof.mulier@telenet.be wrote:<br>
<div>> > <br>
> > Dear QScintilla users,<br>
> > <br>
> > 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.<br>
> > <br>
> > The first option works. The second doesn't. For full details on the problem, please take a look at the following StackOverflow question:<br>
> > <br>
> > http://stackoverflow.com/questions/43962669/setautoindentstyle-on-the-qscintilla-lexer-doesnt-work<br>
> > <br>
> > Do you know the answer?<br>
> <br>
> You have to implement the various block method (blockStart(), blockEnd() etc).<br>
> <br>
> Phil</div>
<br>
<p>Hey Phil,</p>
<p><br>
</p>
<p>Tried implementing <span>blockStart() and blockEnd()</span>, but it throws a TypeError if using for example:</p>
<div style="color:rgb(0,0,0)"><font size="2"><span style="font-size:10pt">
<div class="PlainText"><a href="https://www.riverbankcomputing.com/mailman/listinfo/qscintilla"></a>
<blockquote>
<div><span style="font-size:12pt">def blockStart(self):</span><br>
<span style="font-size:12pt"> return "{"<br>
<br>
<font size="2"><span style="font-size:10pt"><span style="font-size:12pt">def blockEnd(self):</span><br>
<span style="font-size:12pt"> return "}"</span></span></font><br>
</span></div>
</blockquote>
<span style="font-size:12pt"></span>
<div><span style="font-size:12pt">With a bit of trial&error I found that the methods need to return a tuple of (bytes, int). Why?<br>
<br>
Thanks,<br>
Matic<br>
</span></div>
<blockquote>
<div></div>
</blockquote>
</div>
</span></font></div>
</div>
</div>
</div>
</div>
</body>
</html>