mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-04 17:20:55 +07:00
fix JsonEditingTest: don't autoinsert comma if there's no value
This commit is contained in:
@@ -66,7 +66,7 @@ public class JsonEnterHandler extends EnterHandlerDelegateAdapter {
|
|||||||
prevSibling = prevSibling.getPrevSibling();
|
prevSibling = prevSibling.getPrevSibling();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (prevSibling instanceof JsonProperty) {
|
if (prevSibling instanceof JsonProperty && ((JsonProperty)prevSibling).getValue() != null) {
|
||||||
int offset = elementType == JsonElementTypes.COMMA ? nextSibling.getTextRange().getEndOffset() : prevSibling.getTextRange().getEndOffset();
|
int offset = elementType == JsonElementTypes.COMMA ? nextSibling.getTextRange().getEndOffset() : prevSibling.getTextRange().getEndOffset();
|
||||||
if (elementType == JsonElementTypes.R_CURLY) {
|
if (elementType == JsonElementTypes.R_CURLY) {
|
||||||
editor.getDocument().insertString(offset, ",");
|
editor.getDocument().insertString(offset, ",");
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"vcs": {
|
"vcs": {
|
||||||
"schema": "schema://foo.bar/path"
|
"schema": "schema://foo.bar/path"
|
||||||
}
|
},
|
||||||
<caret>
|
<caret>
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user