Merge branch 'emacs-mode'

This commit is contained in:
Chester Wood 2013-01-26 14:52:37 -07:00 committed by nightwing
commit db34cf6a20

View file

@ -66,8 +66,6 @@ exports.handler.attach = function(editor) {
if (!initialized) {
initialized = true;
// in emacs, gotowordleft/right should not count a space as a word..
editor.session.$selectLongWords = true;
dom.importCssString('\
.emacs-mode .ace_cursor{\
border: 2px rgba(50,250,50,0.8) solid!important;\
@ -94,12 +92,21 @@ exports.handler.attach = function(editor) {
}', 'emacsMode'
);
}
// in emacs, gotowordleft/right should not count a space as a word..
editor.session.$selectLongWords = true;
markMode = false;
editor.on("click",$resetMarkMode);
editor.renderer.screenToTextCoordinates = screenToTextBlockCoordinates;
// kitchen sink seems to reload the session after loading the kb handler.
editor.on("changeSession",function(e) {
e.session.$selectLongWords = true;
});
editor.setStyle("emacs-mode");
};
exports.handler.detach = function(editor) {
@ -323,7 +330,7 @@ exports.handler.addCommands({
selectRectangularRegion: function(editor) {
editor.multiSelect.toggleBlockSelection();
},
setMark: function() {
setMark: function(editor) {
// Sets mark-mode and clears current selection.
// When in mark-mode, "goto" commands become "select" commands.
// Any insertion or mouse click resets mark-mode.
@ -374,9 +381,10 @@ exports.handler.addCommands({
},
killLine: function(editor) {
markMode = null;
var pos = editor.getCursorPosition();
if (editor.getCursorPosition().column == 0 &&
editor.selection.isEmpty) {
if (pos.column == 0 &&
editor.session.doc.getLine(pos.row).length == 0) {
// If an already empty line is killed, remove
// the line entirely
editor.selection.selectLine();