Ignore empty lines when finding a fragment for partial updates.

Change hintsPrsentExact to verify number of entries match.
This commit is contained in:
dloverin committed 2013-06-14 11:03:56 -04:00
1 parent 5435d4092e
commit c784efb4c7
2 files changed
+15 -6

No files matched your search

@@ -138,6 +138,7 @@ define(function (require, exports, module) {
}).fail(function (error) {
preferences = new Preferences();
deferredPreferences.resolve();
console.log("Error parsing preference file: " + path);
});
}, function (error) {
preferences = new Preferences();
@@ -507,7 +508,7 @@ define(function (require, exports, module) {
indent;
// expand range backwards
for (p = start.line - 1, min = Math.max(0, p - 50); p >= min; --p) {
for (p = start.line - 1, min = Math.max(0, p - 100); p >= min; --p) {
var line = session.getLine(p),
fn = line.search(/\bfunction\b/);
if (fn >= 0) {
@@ -529,16 +530,22 @@ define(function (require, exports, module) {
minLine = min;
}
var max = Math.min(cm.lastLine(), start.line + 90);
var max = Math.min(cm.lastLine(), start.line + 100),
endCh = 0;
for (endLine = start.line + 1; endLine < max; ++endLine) {
indent = CodeMirror.countColumn(cm.getLine(endLine), null, tabSize);
if (indent <= minIndent) {
break;
var line = cm.getLine(endLine);
if (line.length > 0) {
indent = CodeMirror.countColumn(line, null, tabSize);
if (indent <= minIndent) {
endCh = line.length;
break;
}
}
}
var from = {line: minLine, ch: 0},
to = {line: endLine, ch: 0};
to = {line: endLine, ch: endCh};
return {type: MessageIds.TERN_FILE_INFO_TYPE_PART,
name: document.file.fullPath,