Add option to break lines longer than view width (or static boundary, when dynamic-wrapping at static boundary) anywhere. It merely sets QTextOption::WrapAnywhere for the view, plus exposes that as checkbox in the config and key for saving the configuration.
QTextOption::WrapAtWordBoundaryOrAnywhere is unfortunately very dumb, splitting at space only; while this might be ok for natural languages, it is not suitable for code: e.g. if(eng->option.wrapMode()==QTextOption::WrapAtWordBoundaryOrAnywhere){ has no "word boundary" according the the algorithm. FYI QTtextLayout internally uses QTextEngine::itemize() [https://code.qt.io/cgit/qt/qtbase.git/tree/src/gui/text/qtextengine.cpp?h=dev#n2057](link).
This patch makes a difference also for long lines "without word boundary" which should break anywhere as fallback (as per Qt's docs); in this fallback case, though ktextedit inserts zero-length line at the beginning (this is likely an existing but in ktextedit).
Without breaking anywhere (old behavior, the default):
breaking anywhere:
(My first contribution here.)