Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 342480

Summary: [editor] Indent selection very slow
Product: [ECD] Orion Reporter: John Arthorne <john.arthorne>
Component: ClientAssignee: Silenio Quarti <Silenio_Quarti>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: Silenio_Quarti
Version: 0.2   
Target Milestone: 0.2   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description John Arthorne CLA 2011-04-11 13:57:46 EDT
I20110411, FireFox 4

- Open the editor on a JS file of about 200 lines
- Select All, then hit Tab to indent selection

-> It takes about 5 seconds.

On a 500 line file it takes about 10 seconds. Performing "Undo" afterwards takes a similar amount of time. This seems incredibly slow compared to most other editor operations.
Comment 1 Silenio Quarti CLA 2011-04-11 22:08:34 EDT
I noticed this as well on all browsers. The problem happens because the key bindings added is editorFeatures.js alters the text line by line causing the editor to update the DOM once per line. 

Fixed by make all modifications in memory and altering the editor contents only once.

http://git.eclipse.org/c/e4/org.eclipse.orion.client.git/commit/?id=fd464d2c7675f18a82ec69f7771fb89c5899e6f5