Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Commit

Permalink
Merge async-createFileSystem() API change into in-browser fs branch...
Browse files Browse the repository at this point in the history
Merge branch 'glenn/file-system' into pflynn/in-browser-file-system

* glenn/file-system: (56 commits)
  Change FileSystemManager.createFileSystem() to be async -- allowing filesystem impls time to seed any required initial data, or go through authentication workflows.
  Fix incorrect JSDoc parameter name.
  Updated by ALF automation.
  Update Tern and Acorn to the latest
  Change decompress-zip to the release
  Remove methods from eports
  Fix minor nit
  Added quick-edit.png for Finnish translation
  Find in Files title update
  restore handleWideResults property
  Deprecate FileUtils.getFilenameExtension() (which includes leading "."), introduce new FileUtils.getFileExtension() (which excludes it). Fixes bug #5365.
  Clean up
  Fix #5362 (HTML menu z-index vs. bottom-panel).
  simplify fix by assuming intent is to type (not insert hint)
  Code review cleanups
  Expose code inspection providers for the extensions.
  Update to decompress-zip that includes fix for our issue.
  Code review: use more consts in Find; remove unneeded single-tickmark API
  hasNativeMenus param code cleanup
  code cleanup
  ...

Conflicts:
	src/project/ProjectManager.js
  • Loading branch information
peterflynn committed Oct 3, 2013
2 parents 30dd05a + b08d0d1 commit 327770f
Show file tree
Hide file tree
Showing 134 changed files with 4,531 additions and 6,055 deletions.
3 changes: 2 additions & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,8 @@ module.exports = function (grunt) {
shell: {
repo: grunt.option("shell-repo") || "../brackets-shell",
mac: "<%= shell.repo %>/installer/mac/staging/<%= pkg.name %>.app",
win: "<%= shell.repo %>/installer/win/staging/<%= pkg.name %>.exe"
win: "<%= shell.repo %>/installer/win/staging/<%= pkg.name %>.exe",
linux: "<%= shell.repo %>/installer/linux/debian/package-root/opt/brackets/brackets"
}
});

Expand Down
Binary file added samples/fi/Aloitus/screenshots/quick-edit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions src/brackets.js
Original file line number Diff line number Diff line change
Expand Up @@ -296,14 +296,14 @@ define(function (require, exports, module) {
if (brackets.nativeMenus) {
$("body").addClass("has-appshell-menus");
} else {
// Prevent the menu item to grab the focus -- override focus implementation
// (issue #5310) workaround for bootstrap dropdown: prevent the menu item to grab
// the focus -- override jquery focus implementation for top-level menu items
(function () {
var defaultFocus = $.fn.focus;
$.fn.focus = function () {
if (!this.hasClass("dropdown-toggle")) {
defaultFocus.apply(this, arguments);
return defaultFocus.apply(this, arguments);
}
return this; // FIXME: merge up w/ master!
};
}());
}
Expand Down
50 changes: 49 additions & 1 deletion src/editor/CodeHintList.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,13 @@ define(function (require, exports, module) {
*/
this.insertHintOnTab = insertHintOnTab;

/**
* Pending text insertion
*
* @type {string}
*/
this.pendingText = "";

/**
* The hint selection callback function
*
Expand Down Expand Up @@ -145,6 +152,26 @@ define(function (require, exports, module) {
}
};

/**
* Appends text to end of pending text.
*
* @param {string} text
*/
CodeHintList.prototype.addPendingText = function (text) {
this.pendingText += text;
};

/**
* Removes text from beginning of pending text.
*
* @param {string} text
*/
CodeHintList.prototype.removePendingText = function (text) {
if (this.pendingText.indexOf(text) === 0) {
this.pendingText = this.pendingText.slice(text.length);
}
};

/**
* Rebuilds the list items for the hint list.
*
Expand Down Expand Up @@ -346,7 +373,7 @@ define(function (require, exports, module) {

return itemsPerPage;
}

// If we're no longer visible, skip handling the key and end the session.
if (!this.isOpen()) {
this.handleClose();
Expand Down Expand Up @@ -377,6 +404,27 @@ define(function (require, exports, module) {
} else if (this.selectedIndex !== -1 &&
(keyCode === KeyEvent.DOM_VK_RETURN ||
(keyCode === KeyEvent.DOM_VK_TAB && this.insertHintOnTab))) {

if (this.pendingText) {
// Issues #5003: We received a "selection" key while there is "pending
// text". This is rare but can happen because CM uses polling, so we
// can receive key events while CM is waiting for timeout to expire.
// Pending text may dismiss the list, or it may cause a valid selection
// which keeps open hint list. We can compare pending text against
// list to determine whether list is dismissed or not, but to handle
// inserting selection in the page we'd need to either:
// 1. Synchronously force CodeMirror to poll (but there is not
// yet a public API for that).
// 2. Pass pending text back to where text gets inserted, which
// means it would need to be implemented for every HintProvider!
// You have to be typing so fast to hit this case, that's it's
// highly unlikely that inserting something from list was the intent,
// which makes this pretty rare, so case #2 is not worth implementing.
// If case #1 gets implemented, then we may want to use it here.
// So, assume that pending text dismisses hints and let event bubble.
return false;
}

// Trigger a click handler to commmit the selected item
$(this.$hintMenu.find("li")[this.selectedIndex]).trigger("click");
} else {
Expand Down
Loading

0 comments on commit 327770f

Please sign in to comment.