kopia lustrzana https://github.com/c9/core
Merge pull request +6289 from c9/fix/keybindings
fix +6287 Unable to switch to sublime keybindingspull/39/head
commit
3d6dc854fc
|
@ -733,10 +733,14 @@ CodeMirror.defineExtension = function(name, fn) {
|
||||||
CodeMirror.prototype[name] = fn;
|
CodeMirror.prototype[name] = fn;
|
||||||
};
|
};
|
||||||
dom.importCssString(".normal-mode .ace_cursor{\
|
dom.importCssString(".normal-mode .ace_cursor{\
|
||||||
border: 0!important;\
|
border: 1px solid red;\
|
||||||
background-color: red;\
|
background-color: red;\
|
||||||
opacity: 0.5;\
|
opacity: 0.5;\
|
||||||
}.ace_dialog {\
|
}\
|
||||||
|
.normal-mode .ace_hidden-cursors .ace_cursor{\
|
||||||
|
background-color: transparent;\
|
||||||
|
}\
|
||||||
|
.ace_dialog {\
|
||||||
position: absolute;\
|
position: absolute;\
|
||||||
left: 0; right: 0;\
|
left: 0; right: 0;\
|
||||||
background: white;\
|
background: white;\
|
||||||
|
@ -762,23 +766,6 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
||||||
font-family: monospace;\
|
font-family: monospace;\
|
||||||
}", "vimMode");
|
}", "vimMode");
|
||||||
(function() {
|
(function() {
|
||||||
function dialogDiv(cm, template, bottom) {
|
|
||||||
var wrap = cm.ace.container;
|
|
||||||
var dialog;
|
|
||||||
dialog = wrap.appendChild(document.createElement("div"));
|
|
||||||
if (bottom)
|
|
||||||
dialog.className = "ace_dialog ace_dialog-bottom";
|
|
||||||
else
|
|
||||||
dialog.className = "ace_dialog ace_dialog-top";
|
|
||||||
|
|
||||||
if (typeof template == "string") {
|
|
||||||
dialog.innerHTML = template;
|
|
||||||
} else { // Assuming it's a detached DOM element.
|
|
||||||
dialog.appendChild(template);
|
|
||||||
}
|
|
||||||
return dialog;
|
|
||||||
}
|
|
||||||
|
|
||||||
function closeNotification(cm, newVal) {
|
function closeNotification(cm, newVal) {
|
||||||
if (cm.state.currentNotificationClose)
|
if (cm.state.currentNotificationClose)
|
||||||
cm.state.currentNotificationClose();
|
cm.state.currentNotificationClose();
|
||||||
|
@ -5814,7 +5801,7 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
||||||
}, true);
|
}, true);
|
||||||
}
|
}
|
||||||
return isHandled;
|
return isHandled;
|
||||||
};
|
}
|
||||||
exports.CodeMirror = CodeMirror;
|
exports.CodeMirror = CodeMirror;
|
||||||
var getVim = Vim.maybeInitVimState_;
|
var getVim = Vim.maybeInitVimState_;
|
||||||
exports.handler = {
|
exports.handler = {
|
||||||
|
@ -5828,9 +5815,9 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
||||||
if (!vim.insertMode) {
|
if (!vim.insertMode) {
|
||||||
var isbackwards = !sel.cursor
|
var isbackwards = !sel.cursor
|
||||||
? session.selection.isBackwards() || session.selection.isEmpty()
|
? session.selection.isBackwards() || session.selection.isEmpty()
|
||||||
: Range.comparePoints(sel.cursor, sel.start) <= 0
|
: Range.comparePoints(sel.cursor, sel.start) <= 0;
|
||||||
if (!isbackwards && left > w)
|
if (!isbackwards && left > w)
|
||||||
left -= w
|
left -= w;
|
||||||
}
|
}
|
||||||
if (!vim.insertMode && vim.status) {
|
if (!vim.insertMode && vim.status) {
|
||||||
h = h / 2;
|
h = h / 2;
|
||||||
|
@ -5991,16 +5978,16 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
var renderVirtualNumbers = {
|
var renderVirtualNumbers = {
|
||||||
getText: function(session, row) {
|
getText: function(session, row) {
|
||||||
return (Math.abs(session.selection.lead.row - row) || (row + 1 + (row < 9? "\xb7" : "" ))) + ""
|
return (Math.abs(session.selection.lead.row - row) || (row + 1 + (row < 9? "\xb7" : "" ))) + "";
|
||||||
},
|
},
|
||||||
getWidth: function(session, lastLineNumber, config) {
|
getWidth: function(session, lastLineNumber, config) {
|
||||||
return session.getLength().toString().length * config.characterWidth;
|
return session.getLength().toString().length * config.characterWidth;
|
||||||
},
|
},
|
||||||
update: function(e, editor) {
|
update: function(e, editor) {
|
||||||
editor.renderer.$loop.schedule(editor.renderer.CHANGE_GUTTER)
|
editor.renderer.$loop.schedule(editor.renderer.CHANGE_GUTTER);
|
||||||
},
|
},
|
||||||
attach: function(editor) {
|
attach: function(editor) {
|
||||||
editor.renderer.$gutterLayer.$renderer = this;
|
editor.renderer.$gutterLayer.$renderer = this;
|
||||||
|
@ -6042,7 +6029,7 @@ dom.importCssString(".normal-mode .ace_cursor{\
|
||||||
if (cm.ace.inVirtualSelectionMode)
|
if (cm.ace.inVirtualSelectionMode)
|
||||||
cm.ace.on("beforeEndOperation", delayedExecAceCommand);
|
cm.ace.on("beforeEndOperation", delayedExecAceCommand);
|
||||||
else
|
else
|
||||||
delayedExecAceCommand(null, cm.ace)
|
delayedExecAceCommand(null, cm.ace);
|
||||||
};
|
};
|
||||||
function delayedExecAceCommand(op, ace) {
|
function delayedExecAceCommand(op, ace) {
|
||||||
ace.off("beforeEndOperation", delayedExecAceCommand);
|
ace.off("beforeEndOperation", delayedExecAceCommand);
|
||||||
|
|
|
@ -68,7 +68,7 @@
|
||||||
"c9.ide.run.debug": "#789019f9a7",
|
"c9.ide.run.debug": "#789019f9a7",
|
||||||
"c9.ide.ace.emmet": "#e5f1a92ac3",
|
"c9.ide.ace.emmet": "#e5f1a92ac3",
|
||||||
"c9.ide.ace.gotoline": "#4d1a93172c",
|
"c9.ide.ace.gotoline": "#4d1a93172c",
|
||||||
"c9.ide.ace.keymaps": "#1e42293fb9",
|
"c9.ide.ace.keymaps": "#2477fd8ac6",
|
||||||
"c9.ide.ace.repl": "#ada99852fa",
|
"c9.ide.ace.repl": "#ada99852fa",
|
||||||
"c9.ide.ace.split": "#0ae0151c78",
|
"c9.ide.ace.split": "#0ae0151c78",
|
||||||
"c9.ide.ace.statusbar": "#d7b45bb7c3",
|
"c9.ide.ace.statusbar": "#d7b45bb7c3",
|
||||||
|
|
|
@ -288,12 +288,12 @@ define(function(require, exports, module) {
|
||||||
return commands;
|
return commands;
|
||||||
}
|
}
|
||||||
|
|
||||||
function reset(noReload){
|
function reset(noReload, toDefault){
|
||||||
commandManager.commandKeyBinding = {};
|
commandManager.commandKeyBinding = {};
|
||||||
|
|
||||||
Object.keys(commands).forEach(function(name) {
|
Object.keys(commands).forEach(function(name) {
|
||||||
var cmd = commands[name];
|
var cmd = commands[name];
|
||||||
bindKey(cmd.originalBindKey, cmd);
|
bindKey(toDefault ? cmd.originalBindKey : cmd.bindKey, cmd);
|
||||||
});
|
});
|
||||||
|
|
||||||
if (noReload)
|
if (noReload)
|
||||||
|
|
|
@ -173,9 +173,10 @@ define(function(require, exports, module) {
|
||||||
"By resetting your keybindings to their "
|
"By resetting your keybindings to their "
|
||||||
+ "defaults you will lose all custom keybindings.",
|
+ "defaults you will lose all custom keybindings.",
|
||||||
function(){
|
function(){
|
||||||
|
settings.setJson("user/key-bindings", []);
|
||||||
settings.set("user/ace/@keyboardmode", "default");
|
settings.set("user/ace/@keyboardmode", "default");
|
||||||
settings.set("user/key-bindings/@platform", "auto");
|
settings.set("user/key-bindings/@platform", "auto");
|
||||||
reset();
|
commands.reset(false, true);
|
||||||
}, function(){});
|
}, function(){});
|
||||||
},
|
},
|
||||||
position: 90
|
position: 90
|
||||||
|
|
Ładowanie…
Reference in New Issue