Skip to content

Commit cd06042

Browse files
committed
fixes #706, fixes #743, fixes #699
1 parent 8d4487c commit cd06042

File tree

3 files changed

+21
-3
lines changed

3 files changed

+21
-3
lines changed

src/js/codemirror/anyword-hint.js

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@
148148
var excludeProperties = false;
149149
var excludeAggregates = false;
150150
var candlists = [];
151+
var toexclude = [];
151152
switch (state.section) {
152153
case 'objects':
153154
{
@@ -158,6 +159,10 @@
158159
}
159160
case 'legend':
160161
{
162+
var splits = lineToCursor.toLowerCase().split(/[\p{Z}\s]/u).filter(function(v) {
163+
return v !== '';
164+
});
165+
toexclude=splits;
161166
if (lineToCursor.indexOf('=')>=0){
162167
if ((lineToCursor.trim().split(/\s+/ ).length%2)===1){
163168
addObjects=true;
@@ -177,7 +182,12 @@
177182
}
178183
case 'collisionlayers':
179184
{
185+
var splits = lineToCursor.toLowerCase().split(/[,\p{Z}\s]/u).filter(function(v) {
186+
return v !== '';
187+
});
188+
toexclude=splits;
180189
addObjects=true;
190+
excludeAggregates=true;
181191
break;
182192
}
183193
case 'rules':
@@ -312,7 +322,15 @@
312322
//state.legend_properties
313323
//state.objects
314324

315-
//if list is a single word and that matches what the current word is, don't show hint
325+
//remove words from the toexclude list
326+
for (var i=0;i<list.length;i++){
327+
var lc = list[i].text.toLowerCase();
328+
if (toexclude.indexOf(lc)>=0){
329+
list.splice(i,1);
330+
i--;
331+
}
332+
}
333+
//if list is a single word and that matches what the current word is, don't show hint
316334
if (list.length===1 && list[0].text.toLowerCase()===curWord){
317335
list=[];
318336
}

src/js/compiler.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2682,7 +2682,7 @@ function loadFile(str) {
26822682
while (ss.eol() === false);
26832683
}
26842684

2685-
delete state.lineNumber;
2685+
// delete state.lineNumber;
26862686

26872687
generateExtraMembers(state);
26882688
generateMasks(state);

src/js/parser.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -801,7 +801,7 @@ var codeMirrorFn = function() {
801801
}
802802
if (splits.indexOf(candname, 2)>=2) {
803803
logError("You can't define object " + candname.toUpperCase() + " in terms of itself!", state.lineNumber);
804-
ok = false;
804+
// ok = false;
805805
}
806806
checkNameNew(state,candname);
807807
}

0 commit comments

Comments
 (0)