mirror of
https://github.com/RustyRaptor/brackets.git
synced 2026-12-04 00:15:22 -07:00
prevent entering doEditorChange while it is waiting to complete
This commit is contained in:
1 parent
589dcb0719
commit
7288348147
1 file changed
+19
-3
@@ -716,14 +716,13 @@ define(function (require, exports, module) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Called each time a new editor becomes active. Refreshes the outer scopes
|
||||
* of the given file as well as of the other files in the given directory.
|
||||
* Do the work to initialize a code hinting session.
|
||||
*
|
||||
* @param {Session} session - the active hinting session
|
||||
* @param {Document} document - the document of the editor that has changed
|
||||
* @param {boolean} shouldPrimePump - true if the pump should be primed.
|
||||
*/
|
||||
function handleEditorChange(session, document, shouldPrimePump) {
|
||||
function doEditorChange(session, document, shouldPrimePump) {
|
||||
var path = document.file.fullPath,
|
||||
split = HintUtils.splitPath(path),
|
||||
dir = split.dir,
|
||||
@@ -785,6 +784,23 @@ define(function (require, exports, module) {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Called each time a new editor becomes active.
|
||||
*
|
||||
* @param {Session} session - the active hinting session
|
||||
* @param {Document} document - the document of the editor that has changed
|
||||
* @param {boolean} shouldPrimePump - true if the pump should be primed.
|
||||
*/
|
||||
function handleEditorChange(session, document, shouldPrimePump) {
|
||||
if (addFilesPromise === null) {
|
||||
doEditorChange(session, document, shouldPrimePump);
|
||||
} else {
|
||||
addFilesPromise.done(function () {
|
||||
doEditorChange(session, document, shouldPrimePump);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Called each time the file associated with the active editor changes.
|
||||
* Marks the file as being dirty and refresh its outer scope.
|
||||
|
||||
Reference in new issue
Block a user