Fix backspace shortcut in codemirror
This commit is contained in:
@@ -416,8 +416,12 @@ define([
|
|||||||
"Backspace": function () {
|
"Backspace": function () {
|
||||||
var cursor = doc.getCursor();
|
var cursor = doc.getCursor();
|
||||||
var line = doc.getLine(cursor.line);
|
var line = doc.getLine(cursor.line);
|
||||||
if (line.substring(0, cursor.ch).trim() === "") { editor.execCommand("indentLess"); }
|
var beforeCursor = line.substring(0, cursor.ch);
|
||||||
else { editor.execCommand("delCharBefore"); }
|
if (beforeCursor && beforeCursor.trim() === "") {
|
||||||
|
editor.execCommand("indentLess");
|
||||||
|
} else {
|
||||||
|
editor.execCommand("delCharBefore");
|
||||||
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user