if (hasIdentifierToTheRight(document, offset + length))
return;
// fall through
+ case '{':
+ if (!fCloseBracketsPHP)
+ return;
+ if (hasIdentifierToTheRight(document, offset + length))
+ return;
+ // fall through
case '"':
if (event.character == '"') {
if (!fCloseStringsPHPDQ)
if (!fCloseBracketsPHP) {
return;
}
- if (hasCharacterToTheLeft(document,offset,'{')) {
+ if (hasCharacterToTheLeft(document,offset,'{') && hasCharacterToTheRight(document,offset,'}')) {
String lineDelimiter=StubUtility.getLineDelimiterFor(document);
int caretPos=sourceViewer.getTextWidget().getCaretOffset();
final StringBuffer buffer = new StringBuffer(lineDelimiter);
int cursorPos=buffer.length();
buffer.append(lineDelimiter);
buffer.append(indent);
- buffer.append("}");
document.replace(offset, length, buffer.toString());
sourceViewer.getTextWidget().setCaretOffset(caretPos+cursorPos);
event.doit = false;