Scroll to the selected item in the current document (unless no query string entered yet, in which case the topmost list item is irrelevant)
function itemFocus(selectedItem, query, explicit) {
if (!selectedItem || (query.length < 2 && !explicit)) {
return;
}
var fileLocation = selectedItem.fileLocation;
var from = {line: fileLocation.line, ch: fileLocation.chFrom};
var to = {line: fileLocation.line, ch: fileLocation.chTo};
EditorManager.getCurrentFullEditor().setSelection(from, to, true);
}
Scroll to the selected item in the current document (unless no query string entered yet, in which case the topmost list item is irrelevant)
function itemSelect(selectedItem, query) {
itemFocus(selectedItem, query, true);
}
exports.match = match;
exports.itemFocus = itemFocus;
exports.itemSelect = itemSelect;
});