console: fix bad suggestion (#1207)

This commit is contained in:
Oskar Thorén 2017-07-21 09:38:40 +02:00 committed by Roman Volosovskyi
parent cad5e0c567
commit 263c05ffec
1 changed files with 2 additions and 2 deletions

View File

@ -116,7 +116,7 @@ function getLastForm(code) {
var index = codeLength - 1;
while (index >= 0) {
var char = code[index];
if (level == 0 && (char == '(' || char == ',')) {
if (level == 0 && index != 0 && (char == '(' || char == ',')) {
break;
}
if (char == ')') {
@ -162,7 +162,7 @@ function getLastLevel(code) {
}
index--;
}
if (form.indexOf("(") < 0) {
if (form.indexOf("(") < 0 && form != ",") {
var parts = form.split(',');
form = parts[parts.length - 1];
}