Stop linebreak after lexer style change when using word wrap on wxPython styledtextctrl

152 views Asked by At

I'm working on an text editing app using wx.stc.StyledTextCtrl in wxPython (2.8). I have a large amount of text on one line. I have created custom lexers to highlight certain parts of the text. This works like a charm as long as I do not turn on word wrap. When I do turn word wrap on I get line breaks after each lexer style. I know this is the default and correct behavior of StyledTextCtrl, but it is detrimental to my app. How do I stop the word wrap from making line breaks after each lexer style?

If I could tell it to make a line break every 100 characters that would be perfect. I tried to do this artificially by adding \n when putting the text into the wx.stc.StyledTextCtrl but that did not work well as the absolute numbering of the characters are important. The \n messed up the numbering.

0

There are 0 answers