Bug 472339 - Search and replace incorrect for dirty editors
Summary: Search and replace incorrect for dirty editors
Status: NEW
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext (show other bugs)
Version: 2.8.3   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-07-10 04:34 EDT by Hendrik Eeckhaut CLA
Modified: 2015-07-10 04:47 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Hendrik Eeckhaut CLA 2015-07-10 04:34:37 EDT
When you use the "Search Dialog" (Ctrl+H) to replace text, incorrect replacements are done in dirty editor (files).

To reproduce (with Xtend example, but also fails for our VHDL/Verilog editor):
1. Create a file demo.xtend with content: '''
class Demo {
	
	def demo() {
		println("demo")
	}
	// demo
}
'''
2. Add a few (I added three) newlines before the demo method (but do *not* save")
3. Ctrl+H
4. Enter "demo" as text (*.xtend as pattern)
5. Click "Replace..."
6. Enter "xxxx" in the "With:" field
7. Click "OK"
8. Notice the editor is unchanged
9. When you click the editor, you see a message "The file ... has been changed... replace the editor contents with these changes?", click "Yes"
10. Notice that replacements are completely wrong. It looks like the dirty content was used to calculate the change locations, but the changes were applied on the content on disk.
'''
class xxxx {
	
	
	
		
	def dxxxx) {
		println("dxxxx)
	}
	// dxxxx}
'''
Comment 1 Sebastian Zarnekow CLA 2015-07-10 04:47:03 EDT
Probably caused by the same issue as the no-two-editors-on-same-file missing feature.