Skip to content
This repository was archived by the owner on Sep 6, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/brackets.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ define(function (require, exports, module) {
require("widgets/bootstrap-modal");
require("widgets/bootstrap-twipsy-mod");
require("thirdparty/path-utils/path-utils.min");
require("thirdparty/smart-auto-complete-local/jquery.smart_autocomplete");

// Load CodeMirror add-ons--these attach themselves to the CodeMirror module
require("thirdparty/CodeMirror2/addon/fold/xml-fold");
Expand Down
20 changes: 9 additions & 11 deletions src/extensions/default/QuickOpenCSS/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,20 +84,18 @@ define(function (require, exports, module) {
* @param {boolean} returns true if this plugin wants to provide results for this query
*/
function match(query) {
// TODO: match any location of @ when QuickOpen._handleItemFocus() is modified to
// dynamic open files
//if (query.indexOf("@") !== -1) {
if (query.indexOf("@") === 0) {
return true;
}
return (query[0] === "@");
}

/**
* Select the selected item in the current document
* Scroll to the selected item in the current document (unless no query string entered yet,
* in which case the topmost list item is irrelevant)
* @param {?SearchResult} selectedItem
* @param {string} query
* @param {boolean} explicit False if this is only highlighted due to being at top of list after search()
*/
function itemFocus(selectedItem) {
if (!selectedItem) {
function itemFocus(selectedItem, query, explicit) {
if (!selectedItem || (query.length < 2 && !explicit)) {
return;
}
var selectorInfo = selectedItem.selectorInfo;
Expand All @@ -107,8 +105,8 @@ define(function (require, exports, module) {
EditorManager.getCurrentFullEditor().setSelection(from, to, true);
}

function itemSelect(selectedItem) {
itemFocus(selectedItem);
function itemSelect(selectedItem, query) {
itemFocus(selectedItem, query, true);
}


Expand Down
20 changes: 9 additions & 11 deletions src/extensions/default/QuickOpenHTML/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,21 +118,19 @@ define(function (require, exports, module) {
* @param {boolean} returns true if this plug-in wants to provide results for this query
*/
function match(query) {
// TODO: match any location of @ when QuickOpen._handleItemFocus() is modified to
// dynamic open files
//if (query.indexOf("@") !== -1) {
if (query.indexOf("@") === 0) {
return true;
}
return (query[0] === "@");
}


/**
* Select the selected item in the current document
* Scroll to the selected item in the current document (unless no query string entered yet,
* in which case the topmost list item is irrelevant)
* @param {?SearchResult} selectedItem
* @param {string} query
* @param {boolean} explicit False if this is only highlighted due to being at top of list after search()
*/
function itemFocus(selectedItem) {
if (!selectedItem) {
function itemFocus(selectedItem, query, explicit) {
if (!selectedItem || (query.length < 2 && !explicit)) {
return;
}
var fileLocation = selectedItem.fileLocation;
Expand All @@ -142,8 +140,8 @@ define(function (require, exports, module) {
EditorManager.getCurrentFullEditor().setSelection(from, to, true);
}

function itemSelect(selectedItem) {
itemFocus(selectedItem);
function itemSelect(selectedItem, query) {
itemFocus(selectedItem, query, true);
}


Expand Down
20 changes: 9 additions & 11 deletions src/extensions/default/QuickOpenJavaScript/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,20 +112,18 @@ define(function (require, exports, module) {
*/
function match(query) {
// only match @ at beginning of query for now
// TODO: match any location of @ when QuickOpen._handleItemFocus() is modified to
// dynamic open files
//if (query.indexOf("@") !== -1) {
if (query.indexOf("@") === 0) {
return true;
}
return (query[0] === "@");
}

/**
* Select the selected item in the current document
* Scroll to the selected item in the current document (unless no query string entered yet,
* in which case the topmost list item is irrelevant)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

documentation doesn't match the current function signature

* @param {?SearchResult} selectedItem
* @param {string} query
* @param {boolean} explicit False if this is only highlighted due to being at top of list after search()
*/
function itemFocus(selectedItem) {
if (!selectedItem) {
function itemFocus(selectedItem, query, explicit) {
if (!selectedItem || (query.length < 2 && !explicit)) {
return;
}
var fileLocation = selectedItem.fileLocation;
Expand All @@ -135,8 +133,8 @@ define(function (require, exports, module) {
EditorManager.getCurrentFullEditor().setSelection(from, to, true);
}

function itemSelect(selectedItem) {
itemFocus(selectedItem);
function itemSelect(selectedItem, query) {
itemFocus(selectedItem, query, true);
}


Expand Down
Loading