Created attachment 109380 [details] typical file with long lines I use a tool to generates tables in a source code. Result contains 3 very long LOCs (~1000 columns). Trying to select them in In KWrite 17.08.1 and using SHIFT + CTRL + ARROWS is very slow, there's a lag for each ARROW keystroke. I attach a demo file, play with selection to verify the bug. Just CTRL + A should show the issue. Then reduce the selection with SHIFT + CTRL + LEFT ARROW to see how it is annoying. The problem happens even with no syntax highlihgting and with max line size set to 4096.
*** Bug 390645 has been marked as a duplicate of this bug. ***
Nowadays, 2019, it seems that the problem only happens with highligthning toggled on.
To add: hooking up gdb and upping the line length to 15k to make it easier to debug, the backtrace generally looks like #1 QTextLine::draw(QPainter*, QPointF const&, QTextLayout::FormatRange const*) const () #2 QTextLayout::draw(QPainter*, QPointF const&, QVector<QTextLayout::FormatRange> const&, QRectF const&) const () #3 KateRenderer::paintTextLine (this=this@entry=0x555633e445c0, paint=..., range=..., xStart=xStart@entry=0, xEnd=xEnd@entry=972, cursor=cursor@entry=0x7ffdad493418, flags=...) #4 KateViewInternal::paintEvent (this=0x555633dc4670, e=0x7ffdad493720) #5 QWidget::event(QEvent*) () There seems to only be one call to QTextLayout::draw causing the majority of the slowdown.
(In reply to b2.temp from comment #2) > Nowadays, 2019, it seems that the problem only happens with highligthning > toggled on. Looks like there is ongoing work on this: https://phabricator.kde.org/D17241 "WIP:Disable highlighting after 512 characters on a line." (In reply to FeepingCreature from comment #3) > There seems to only be one call to QTextLayout::draw causing the majority of > the slowdown. This old (still open) Qt issue seems to match the topic of the report: https://bugreports.qt.io/browse/QTBUG-21699 "QTextDocumentLayout::draw() is slow if there is text selection" Quote: "its seems that QTextLayout is still used for text rendering, making it possible that this problem is present also on Qt5" I actually don't repro the slowness with attachment 109380 [details], but have constantly ran into the issue of long lines causing Kate to basically hang. Unzip any ODF document and open its content.xml to experience it. I always have to beautify XML to work with it. Notepad++, for example, has never had these problems.
*** Bug 407042 has been marked as a duplicate of this bug. ***
The selection issue is IMHO fixed. The issue with the highlighting not. Actually, long lines create 10000ths of highlighting ranges, we will fix this in bug 345775. *** This bug has been marked as a duplicate of bug 345775 ***