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

Bug 377317

Summary: [Search]Should use textModel to handle line endings and use setText to generate new file.
Product: [ECD] Orion Reporter: libing wang <libingw>
Component: ClientAssignee: libing wang <libingw>
Status: RESOLVED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: Silenio_Quarti
Version: 0.4   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description libing wang CLA 2012-04-20 17:12:10 EDT
In global search&replace and compare, I have several places  using string.split() to generate an array as line contents.
I also created a function called splitFile in util.js.

These will be hard to maintain in the future. E.g. if we treat mixed line endings in a different way in the editor. It is also bad in terms of caching a buffer of long split text.

I will clean up all the codes in this area, where string.split is used.
Comment 1 libing wang CLA 2012-06-12 09:29:36 EDT
Might be complicated using filter for the partial replacement. Will see if it is doable after I fix other RC2s.
Comment 2 libing wang CLA 2013-06-27 13:26:58 EDT
Bug 411644 was fixed on the editor side. But we need a better approach from the text model + find.js.
We need to use the iterator from the text Model find API, then get all the ranges and ask the replace API to replace all the ranges. After model side is done, we update UI.
After talking to Silenio, the range list approach can also be shared by the global search&replace. In the global search we need a subset of the range list, given that user can select which matches are meant to replace or not.
Comment 3 John Arthorne CLA 2015-05-05 14:40:09 EDT
Closing as part of a mass clean up of inactive bugs. Please reopen if this problem still occurs or is relevant to you. For more details see:

https://dev.eclipse.org/mhonarc/lists/orion-dev/msg03444.html