Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[Bug 417754] [Editor] Fixed issue where focusing editor while saving …
…sometimes causes caret to jump to top of file. --Signed-off-by: Steve Jahns <s.t.jahns@gmail.com>
  • Loading branch information
stjahns committed Sep 21, 2013
1 parent 88b9bad commit 4da7684
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions bundles/org.eclipse.orion.client.ui/web/orion/inputManager.js
Expand Up @@ -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.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.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));
Expand Down

0 comments on commit 4da7684

Please sign in to comment.