Bug 269408

Summary: Kate freezes when adding a line in long Lua tables
Product: [Applications] kate Reporter: Unknown <null>
Component: generalAssignee: KWrite Developers <kwrite-bugs-null>
Status: RESOLVED WORKSFORME    
Severity: normal CC: christoph, devel, ilmari.lauhakangas, justin.zobel, matthias, mikisabate
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: Test file

Description Unknown 2011-03-25 19:21:19 UTC
Created attachment 58336 [details]
Test file

Version:           unspecified (using KDE 4.6.1) 
OS:                Linux

In a lua table of this format:
tbl = {
 "item",
 "item",
 "item",
 "item",
 ...
}

Adding a newline inside the table freezes kate. The more items there are, the longer it takes. Tab or space doesn't matter. Untested without linewrap or without highlight.

Reproducible: Always

Steps to Reproduce:
Open attached file, add a newline inside the table.

Add more items to the table if needs be.

Actual Results:  
Freezes

Expected Results:  
Shouldn't freeze
Comment 1 Christoph Cullmann 2011-06-24 20:06:20 UTC
Thats the Lua Indenter.
Comment 2 Jonathan 2011-06-26 12:29:11 UTC
The code is copied from Ruby indenter, there it seems to be the same, will have a look at it.
Comment 3 Dominik Haumann 2012-03-10 19:49:32 UTC
Jonathan, any news? Maybe add a maximum line limitation when looking backward to find the correct indent level, and if none found, just use the one from the previous line. Or add a special function written in C to make it work fast.
Comment 4 Jonathan Schmidt-Dominé 2012-03-10 21:19:58 UTC
It happens with every long statement in Ruby and Lua mode, probably because of a linear time “findStmtStart”-implementation. cstyle.js has no such problem. It would probably need a bit more clever implementation of the indentation not searching the beginning of statements again and again.
Comment 5 Jonathan Schmidt-Dominé 2012-03-10 21:20:50 UTC
Does anybody know how the Ruby indenter exactly works?
Comment 6 Dominik Haumann 2013-08-14 11:46:17 UTC
Jonathan, any change that this gets fixed? You can also add a function to KateScriptDocument and implement the time-critical parts in C++. Then it will be fast. Just follow http://kate-editor.org/get-it/ to get a self-built Kate Part.
Comment 7 Christoph Cullmann 2014-09-22 19:11:47 UTC
*** Bug 314906 has been marked as a duplicate of this bug. ***
Comment 8 Buovjaga 2016-06-19 13:49:09 UTC
No freeze here.

Arch Linux 64-bit
Kate 16.04.2
KDE Frameworks 5.22.0
Qt 5.6.1
xcb wm
Comment 9 Justin Zobel 2020-10-27 02:06:31 UTC
I've tested this in the latest Kate and cannot reproduce.

Please re-test and confirm if the issue still persists.
Comment 10 Bug Janitor Service 2020-11-11 04:33:37 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 11 Bug Janitor Service 2020-11-26 04:33:52 UTC
This bug has been in NEEDSINFO status with no change for at least
30 days. The bug is now closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!