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