<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">
<blockquote style="border-color: rgb(200, 200, 200); border-left: 3px solid rgb(200, 200, 200); padding-left: 1ex; margin-left: 0.8ex; color: rgb(102, 102, 102);">
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div id="appendonsend"></div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<font style="font-size:11pt" face="Calibri, sans-serif" color="#000000"><b>From:</b> Phil Thompson <phil@riverbankcomputing.com></font><br>
</div>
<div dir="ltr"><font style="font-size:11pt" face="Calibri, sans-serif" color="#000000"><b>Sent:</b> Monday, April 6, 2020 12:45 PM<br>
<b>To:</b> Matic Kukovec <kukovecmatic@hotmail.com><br>
<b>Cc:</b> QScintilla <qscintilla@riverbankcomputing.com><br>
<b>Subject:</b> Re: [QScintilla] Resetting a lexer resets margin font?</font>
<div> </div>
</div>
<div><font size="2"><span style="font-size:11pt">
<div>On 29/03/2020 21:11, Matic Kukovec wrote:<br>
> Hi guys,<br>
> <br>
> In the example in the attachment (lexer_change.py) when reseting the<br>
> lexer of the QSciScintilla editor<br>
> by pressing the button RESET LEXER on the top, the margin font gets<br>
> reset to the default and brace matching<br>
> becomes weird (the braces move to the left when the cursor is on a <br>
> brace-pair).<br>
> <br>
> In the attached example this happens always, but I have code where<br>
> this does not happen, but the code is more or less the same.<br>
> Am I missing something or is this a bug?<br>
> <br>
> Specs:<br>
> Windows 10<br>
> PyQt 5.14.0 or PyQt 5.14.1<br>
> QScintilla 2.11.4<br>
<br>
When a new lexer is set a lot of (apparently lexer-independent) state <br>
gets reset. This is a feature of the underlying Scintilla <br>
</div>
<div>implementation.</div>
<div><br>
</div>
<div>Phil</div>
</span></font></div>
</blockquote>
<div><font size="2"><span style="font-size:11pt"></span></font></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Thank you Phil, I did not know that.</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
The problem is not restyling the margin font after this happens, it's the brace matching that I don't know how to reset back to the normal style?</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
This is what happens:</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<img size="20211" contenttype="image/gif" style="max-width: 100%; user-select: none;" unselectable="on" tabindex="-1" data-outlook-trace="F:1|T:1" src="cid:d60c6c80-379f-4205-9d39-f7c799947769"></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
How do I switch the brace style back to the first one in the above animation? The first one is the slightly thicker braces, before the button press.</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Thanks,</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Matic<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
</body>
</html>