Modules (181)

QuickOpenHelper

Description

Dependencies

Functions

Public API

itemFocus

Scroll to the selected item in the current document (unless no query string entered yet, in which case the topmost list item is irrelevant)

selectedItem nullable SearchResult
query string
explicit boolean
False if this is only highlighted due to being at top of list after search()
    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);
    }
Public API

itemSelect

Scroll to the selected item in the current document (unless no query string entered yet, in which case the topmost list item is irrelevant)

selectedItem nullable SearchResult
query string
    function itemSelect(selectedItem, query) {
        itemFocus(selectedItem, query, true);
    }
    
    exports.match      = match;
    exports.itemFocus  = itemFocus;
    exports.itemSelect = itemSelect;
});
Public API

match

query string
what the user is searching for
returns boolean
true if this plug-in wants to provide results for this query
    function match(query) {
        return (query[0] === "@");
    }