Bug 470842 - [Rename] Hitting rename when already in rename causes unexpected behavior
diff --git a/bundles/org.eclipse.orion.client.javascript/web/javascript/commands/renameCommand.js b/bundles/org.eclipse.orion.client.javascript/web/javascript/commands/renameCommand.js
index caa9b34..402265f 100644
--- a/bundles/org.eclipse.orion.client.javascript/web/javascript/commands/renameCommand.js
+++ b/bundles/org.eclipse.orion.client.javascript/web/javascript/commands/renameCommand.js
@@ -49,6 +49,7 @@
 						}
 						var groups = [{data: {}, positions: offsets}];
 						var linkModel = {groups: groups};
+						deferred.resolve(cachedContext.exitLinkedMode());
 						deferred.resolve(cachedContext.enterLinkedMode(linkModel));
 					} 
 					deferred.resolve();
diff --git a/bundles/org.eclipse.orion.client.ui/web/orion/editorView.js b/bundles/org.eclipse.orion.client.ui/web/orion/editorView.js
index 418e33b..aa9e1f3 100644
--- a/bundles/org.eclipse.orion.client.ui/web/orion/editorView.js
+++ b/bundles/org.eclipse.orion.client.ui/web/orion/editorView.js
@@ -542,6 +542,9 @@
 			contextImpl.enterLinkedMode = function(linkedModeModel) {

 				editor.getLinkedMode().enterLinkedMode(linkedModeModel);

 			};

+			contextImpl.exitLinkedMode = function(escapePosition) {

+				editor.getLinkedMode().exitLinkedMode(escapePosition);

+			};

 			/**

 			 * @description Opens the given location

 			 * @function