aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Jahns2013-09-24 14:31:56 (EDT)
committeradmin2013-09-24 14:32:35 (EDT)
commit9534c3d9d139914d2edbc14082e0604296a73f63 (patch)
treec2c960cd658f6c75820417c043aaf1e7df937766
parent119bab83d939ae491f67a62c9f3f506d77da27b5 (diff)
downloadorg.eclipse.orion.client-9534c3d9d139914d2edbc14082e0604296a73f63.zip
org.eclipse.orion.client-9534c3d9d139914d2edbc14082e0604296a73f63.tar.gz
org.eclipse.orion.client-9534c3d9d139914d2edbc14082e0604296a73f63.tar.bz2
Bug 417754 - Editor caret jumps to top of file if file is saved at the same time editor gets focusSigned-off-by: Steve Jahns <s.t.jahns@gmail.com>
-rw-r--r--bundles/org.eclipse.orion.client.ui/web/orion/inputManager.js24
1 files changed, 13 insertions, 11 deletions
diff --git a/bundles/org.eclipse.orion.client.ui/web/orion/inputManager.js b/bundles/org.eclipse.orion.client.ui/web/orion/inputManager.js
index d5d44f5..788048b 100644
--- a/bundles/org.eclipse.orion.client.ui/web/orion/inputManager.js
+++ b/bundles/org.eclipse.orion.client.ui/web/orion/inputManager.js
@@ -110,18 +110,20 @@ define([
var progressService = this.progressService;
var editor = this.getEditor();
if (this._fileMetadata) {
- //Reload if auto of sync
- progressService.progress(fileClient.read(fileURI, true), i18nUtil.formatMessage(messages.ReadingMetadata, fileURI)).then(function(data) {
- if (this._fileMetadata && this._fileMetadata.Location === data.Location && this._fileMetadata.ETag !== data.ETag) {
- this._fileMetadata = data;
- if (!editor.isDirty() || window.confirm(messages.loadOutOfSync)) {
- progressService.progress(fileClient.read(fileURI), i18nUtil.formatMessage(messages.Reading, fileURI)).then(function(contents) {
- editor.setInput(fileURI, null, contents);
- this._unsavedChanges = [];
- }.bind(this));
+ //Reload if out of sync, unless we are already in the process of saving
+ if (!this._saving) {
+ progressService.progress(fileClient.read(fileURI, true), i18nUtil.formatMessage(messages.ReadingMetadata, fileURI)).then(function(data) {
+ if (this._fileMetadata && this._fileMetadata.Location === data.Location && this._fileMetadata.ETag !== data.ETag) {
+ this._fileMetadata = data;
+ if (!editor.isDirty() || window.confirm(messages.loadOutOfSync)) {
+ progressService.progress(fileClient.read(fileURI), i18nUtil.formatMessage(messages.Reading, fileURI)).then(function(contents) {
+ editor.setInput(fileURI, null, contents);
+ this._unsavedChanges = [];
+ }.bind(this));
+ }
}
- }
- }.bind(this));
+ }.bind(this));
+ }
} else {
var progressTimeout = window.setTimeout(function() {
editor.reportStatus(i18nUtil.formatMessage(messages.Fetching, fileURI));