I recently stumbled upon
QScintilla, which comes with very easy to use Python bindings.
For example, the following proof-of-concept code that I found on the Internet is enough to display an editor with document-based autocompletion:
Code:
"""Base code originally from: http://kib2.free.fr/tutos/PyQt4/QScintilla2.html"""
import sys
import os
from PyQt5 import QtWidgets, Qsci
app = QtWidgets.QApplication(sys.argv)
editor = Qsci.QsciScintilla()
lexer = Qsci.QsciLexerPython(editor)
editor.setLexer(lexer)
editor.setAutoCompletionThreshold(1)
editor.setAutoCompletionSource(Qsci.QsciScintilla.AcsDocument)
editor.show()
editor.setText(open(sys.argv[0]).read())
sys.exit(app.exec_())
QScintilla/Scintilla also supports code folding, code highlighting and recordable macros. IMHO, it'd make for a useful addition to the Python interpreter bundled with Sigil. (The Windows version of the library would only add about 7.5MB.)
@KevinH @DiapDealer what do you guys think about this idea?