When trying to add a closing bracket (square one "]" or curly one "}") to the end of the attached .rb Ruby file, kate hangs. It will consume 100% CPU load and be unresponsive until I kill it with "killall -9 kate". Reproducible: Always Steps to Reproduce: 1. Open the attached file from this bug report with kate. 2. Make sure highlighting mode is "Ruby". 3. Go to the EOF position (Ctrl + End) and enter the "]" or "}" with your keyboard. Actual Results: kate hangs: it will consume 100% CPU load and be unresponsive until I kill it with "killall -9 kate". The "]" resp. "}" character will not be shown on screen either. Expected Results: Showing "]" resp. "}" character, proceeding normally. Will attach the concerned file in a comment.
Created attachment 77139 [details] file that makes kate hang when typing ] or } at EOF Forgot to mention: kate version 3.8.5 Using KDE Development Platform 4.8.5 (4.8.5)
Cannot reproduce. May it be that you have a really slow machine? Because when the cursor is at a ] or } or ), kate searches for the matching {[( upwards. In this case, this maybe span lots of lines (1100 in the document), since there is no matching part.
You were right, it did not hang in an infinite loop but only took a lot of time to show the "}". I tested again with the attached file: 75 s to complete when inserting "}" at EOF 15 s to complete when inserting "}" at roughly 50% position 3 s to complete when inserting "}" at roughly 25% position So for every doubling of lines, a 5x in computation time. My machine is a Core2 Duo 1.6 GHz, so not exactly really slow. How fast is the test for you? How fast is it when you duplicate the file content? In any case, it seems like some inefficient code is in there, as typing a character should not take a minute even if it means going through 1000 lines ;-)
*** This bug has been marked as a duplicate of bug 269408 ***