0

How can I remove a lexer in qscintilla that I have set with.setLexer(lexer) if the user wants to go back to plain text? I have not found anything in the documentation. I'm using PyQt5 with Python3.

eyllanesc
  • 235,170
  • 19
  • 170
  • 241
JakobDev
  • 142
  • 1
  • 8

1 Answers1

0

I tried as @ekumoro replied in the comment above and it is working pretty fine.

self.__editor.setLexer(None)

https://scintilla.sourceforge.io/ScintillaDoc.html#SCI_SETLEXER enter image description here

Rida Shamasneh
  • 767
  • 1
  • 6
  • 16
  • 1
    The `setLexer` slot is part of the QScintilla API and the docs for it are [here](https://www.riverbankcomputing.com/static/Docs/QScintilla/classQsciScintilla.html#a7bc5fb5d0daf8261544fb6fe738a0c91). The `SCI_SETLEXER` message is part of the underlying Scintilla API, and it does not do the same thing. – ekhumoro Dec 23 '19 at 22:02
  • u'r right ... thanks for the link however, the API names are close – Rida Shamasneh Dec 24 '19 at 08:14