diff --git a/bundles/org.eclipse.orion.client.ui/web/orion/compare/compareView.js b/bundles/org.eclipse.orion.client.ui/web/orion/compare/compareView.js index 0d85f7f..8cd66cd 100644 --- a/bundles/org.eclipse.orion.client.ui/web/orion/compare/compareView.js +++ b/bundles/org.eclipse.orion.client.ui/web/orion/compare/compareView.js @@ -440,6 +440,7 @@ var view = new mTextView.TextView({ parent: parentDiv, readonly: readonly, + wrappable: true, tabSize: 4 }); this._viewLoadedCounter++; diff --git a/bundles/org.eclipse.orion.client.ui/web/orion/editorCommands.js b/bundles/org.eclipse.orion.client.ui/web/orion/editorCommands.js index 3e3ac61..32b306e 100644 --- a/bundles/org.eclipse.orion.client.ui/web/orion/editorCommands.js +++ b/bundles/org.eclipse.orion.client.ui/web/orion/editorCommands.js @@ -302,11 +302,33 @@ this.commandService.registerCommandContribution(this.editorContextMenuId, command.id, position, parentPath); } }, - overwriteKeyBindings: function(editor) { + overwriteKeyBindings: function(editor, settings) { var that = this; this.editor = editor; if (editor.getTextView && editor.getTextView()) { var textView = editor.getTextView(); + settings = settings || {}; + + textView.setAction("toggleWrapMode", function() { //$NON-NLS-0$ + textView.invokeAction("toggleWrapMode", true); //$NON-NLS-0$ + var wordWrap = textView.getOptions("wrapMode"); //$NON-NLS-0$ + settings.wordWrap = wordWrap; + if (that.editorPreferences) { + that.editorPreferences.setPrefs(settings); + } + return true; + }); + + textView.setKeyBinding(new mKeyBinding.KeyStroke('z', true, false, true), "toggleZoomRuler"); //$NON-NLS-1$ //$NON-NLS-2$ + textView.setAction("toggleZoomRuler", function() { //$NON-NLS-0$ + if (!settings.zoomRulerVisible) return false; + settings.zoomRuler = !settings.zoomRuler; + if (that.editorPreferences) { + that.editorPreferences.setPrefs(settings); + } + return true; + }, {name: messages.toggleZoomRuler}); + textView.setKeyBinding(new mKeyBinding.KeyBinding('s', true), "save"); //$NON-NLS-1$ //$NON-NLS-2$ var saveCommand = that.commandService.findCommand("orion.edit.save"); //$NON-NLS-0$ textView.setAction("save", function() { //$NON-NLS-0$ 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 253a0cf..2c48523 100644 --- a/bundles/org.eclipse.orion.client.ui/web/orion/editorView.js +++ b/bundles/org.eclipse.orion.client.ui/web/orion/editorView.js @@ -332,30 +332,10 @@ that.updateSourceCodeActions(that.settings, keyBindings.sourceCodeActions); var textView = editor.getTextView(); - textView.setAction("toggleWrapMode", function() { //$NON-NLS-0$ - textView.invokeAction("toggleWrapMode", true); //$NON-NLS-0$ - var wordWrap = textView.getOptions("wrapMode"); //$NON-NLS-0$ - that.settings.wordWrap = wordWrap; - if (that.editorPreferences) { - that.editorPreferences.setPrefs(that.settings); - } - return true; - }); - - textView.setKeyBinding(new mKeyBinding.KeyStroke('z', true, false, true), "toggleZoomRuler"); //$NON-NLS-1$ //$NON-NLS-2$ - textView.setAction("toggleZoomRuler", function() { //$NON-NLS-0$ - if (!that.settings.zoomRulerVisible) return false; - that.settings.zoomRuler = !that.settings.zoomRuler; - if (that.editorPreferences) { - that.editorPreferences.setPrefs(that.settings); - } - return true; - }, {name: messages.toggleZoomRuler}); - that.vi = that.emacs = null; that.updateKeyMode(that.settings, textView); - editorCommands.overwriteKeyBindings(editor); + editorCommands.overwriteKeyBindings(editor, that.settings); return keyBindings; };