DevBoost / EMFText

EMFText is an Eclipse plug-in that allows you to define text syntax for languages described by an Ecore metamodel. EMFText enables developers to define textual Domain Specific Languages quickly and without the need to learn new technologies and concepts.
14 stars 12 forks source link

Automated Insertion of closing Curly Bracket and Indentation when inserting Line Break after opening Bracket #34

Closed marcusmunzert closed 11 years ago

marcusmunzert commented 11 years ago

Meanwhile the editor that gets generated by EMFText SDK has the functionality to automatically adding a closing bracket and indenting the cursor when a line break is being inserted after an opening bracket.

That's fine. However, the indentation of the cursor and the inserted closing bracket is always relative to the line start. Any leading whitespaces of the previous line are ignored. Would it be possible to extend that functinality to additionally add any leading whitespaces of the line that contains the opening bracket to the cursor position and to the closing bracket? Here is an example of how it is working at the moment, when inserting a line break after "field f1 : String {"

entity MyEntity {
    field f1 : String {
    <CURSOR-POS>    
}
}

After my proposed changes, the code would look like this:

entity MyEntity {
    field f1 : String {
        <CURSOR-POS>    
    }
}
mirkoseifert commented 11 years ago

Hi Marcus,

you're right. The proposed behavior would be more intuitive. I'll label this issue as a bug and we'll see what we can do about it.

Cheers,

Mirko

mirkoseifert commented 11 years ago

Hi Marcus,

this should be fixed now. Please try again once the builds are ready (in about 30 minutes max).

Cheers,

Mirko

marcusmunzert commented 11 years ago

Hi Mirko,

Thank you for the fix, I appreciate that. Tried it out, works like a charm.

Cheers, Marcus

mirkoseifert commented 11 years ago

You're very welcome :)