Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 368827 - [Xtext] [EmbeddedEditor] bogus selection after initial creation with empty initial model
Summary: [Xtext] [EmbeddedEditor] bogus selection after initial creation with empty in...
Status: CLOSED FIXED
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext (show other bugs)
Version: 2.3.0   Edit
Hardware: Macintosh Mac OS X
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-17 09:28 EST by Holger Schill CLA
Modified: 2017-10-31 11:17 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 Holger Schill CLA 2012-01-17 09:28:00 EST
When an EmbeddedEditor is created without an initial model org.eclipse.xtext.ui.editor.embedded.EmbeddedEditor.createPartialEditor() and after that somebody calls org.eclipse.xtext.ui.editor.embedded.EmbeddedEditorModelAccess.updateModel(String, String, String) the complete input is selected.

Hacky workaround: 
Call createPartialEditor("","x","",false") with a single char.
Comment 1 Holger Schill CLA 2013-01-28 10:35:35 EST
This is because of https://bugs.eclipse.org/bugs/show_bug.cgi?id=368827 .

I've move the creation of the org.eclipse.xtext.ui.editor.embedded.EmbeddedEditorModelAccess in the hover to a codesection that is only called if there is sugar. When 368827 is fixed we can move the codeline back to createContents without initial content.

pushed to master.
Comment 2 Sylvain Heraud CLA 2014-01-07 09:45:57 EST
Hello,

I have the same issue with Xtext 2.5.0, the workaround still works !
Comment 3 Eclipse Webmaster CLA 2017-10-31 11:06:18 EDT
Requested via bug 522520.

-M.
Comment 4 Eclipse Webmaster CLA 2017-10-31 11:17:39 EDT
Requested via bug 522520.

-M.