diff --git a/lib/ace/keyboard/emacs.js b/lib/ace/keyboard/emacs.js index d6c54b72..4a4a6b8c 100644 --- a/lib/ace/keyboard/emacs.js +++ b/lib/ace/keyboard/emacs.js @@ -3,7 +3,7 @@ * * Copyright (c) 2010, Ajax.org B.V. * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright @@ -14,7 +14,7 @@ * * Neither the name of Ajax.org B.V. nor the * names of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE @@ -89,9 +89,9 @@ exports.handler.attach = function(editor) { // CTRL-A should go to actual beginning of line $formerLineStart = editor.session.$useEmacsStyleLineStart; editor.session.$useEmacsStyleLineStart = true; - + editor.session.$emacsMark = null; - + exports.markMode = function() { return editor.session.$emacsMark; } @@ -129,7 +129,7 @@ var $kbSessionChange = function(e) { e.oldSession.$selectLongWords = $formerLongWords; e.oldSession.$useEmacsStyleLineStart = $formerLineStart; } - + $formerLongWords = e.session.$selectLongWords; e.session.$selectLongWords = true; $formerLineStart = e.session.$useEmacsStyleLineStart; @@ -137,7 +137,7 @@ var $kbSessionChange = function(e) { if (!e.session.hasOwnProperty('$emacsMark')) e.session.$emacsMark = null; -} +} var $resetMarkMode = function(e) { e.editor.session.$emacsMark = null; @@ -256,11 +256,11 @@ exports.handler.handleKeyboard = function(data, hashId, key, keyCode) { exports.emacsKeys = { // movement - "Up|C-p" : {command: "goorselect", args: ["golineup","selectup"]}, - "Down|C-n" : {command: "goorselect", args: ["golinedown","selectdown"]}, + "Up|C-p" : {command: "goorselect", args: ["golineup","selectup"]}, + "Down|C-n" : {command: "goorselect", args: ["golinedown","selectdown"]}, "Left|C-b" : {command: "goorselect", args: ["gotoleft","selectleft"]}, "Right|C-f" : {command: "goorselect", args: ["gotoright","selectright"]}, - "C-Left|M-b" : {command: "goorselect", args: ["gotowordleft","selectwordleft"]}, + "C-Left|M-b" : {command: "goorselect", args: ["gotowordleft","selectwordleft"]}, "C-Right|M-f" : {command: "goorselect", args: ["gotowordright","selectwordright"]}, "Home|C-a" : {command: "goorselect", args: ["gotolinestart","selecttolinestart"]}, "End|C-e" : {command: "goorselect", args: ["gotolineend","selecttolineend"]}, @@ -320,7 +320,7 @@ exports.emacsKeys = { "M-u": "touppercase", // Doesn't work "M-l": "tolowercase", "M-/": "autocomplete", // Doesn't work - "C-u": "universalArgument", + "C-u": "universalArgument", "M-;": "togglecomment", @@ -340,7 +340,7 @@ exports.handler.addCommands({ recenterTopBottom: function(editor) { var renderer = editor.renderer; var pos = renderer.$cursorLayer.getPixelPosition(); - var h = renderer.$size.scrollerHeight - renderer.lineHeight; + var h = renderer.$size.scrollerHeight - renderer.lineHeight; var scrollTop = renderer.scrollTop; if (Math.abs(pos.top - scrollTop) < 2) { scrollTop = pos.top - h; @@ -357,7 +357,7 @@ exports.handler.addCommands({ setMark: function(editor) { // Emulate emacs highlighting behaviour in transient-mark-mode. // Sets mark-mode and clears current selection. - // When mark is set, keyboard cursor movement commands become + // When mark is set, keyboard cursor movement commands become // selection modification commands. That is, // "goto" commands become "select" commands. // Any insertion or mouse click resets mark-mode. @@ -379,7 +379,7 @@ exports.handler.addCommands({ markMode = editor.getCursorPosition(); exports.setMarkMode(markMode); editor.selection.setSelectionAnchor(markMode.row, markMode.column); - + }, exchangePointAndMark: { exec: function(editor) {