mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-17 16:44:49 -04:00
Upgrade CodeMirror to 5.10.1 and now support fullscreen, jump-to-line in editor
This commit is contained in:
parent
ce65e58096
commit
eaa8ccaccb
381 changed files with 6726 additions and 2636 deletions
35
public/vendor/codemirror/keymap/vim.js
vendored
Executable file → Normal file
35
public/vendor/codemirror/keymap/vim.js
vendored
Executable file → Normal file
|
@ -292,12 +292,7 @@
|
|||
// Keypress character binding of format "'a'"
|
||||
return key.charAt(1);
|
||||
}
|
||||
var pieces = key.split('-');
|
||||
if (/-$/.test(key)) {
|
||||
// If the - key was typed, split will result in 2 extra empty strings
|
||||
// in the array. Replace them with 1 '-'.
|
||||
pieces.splice(-2, 2, '-');
|
||||
}
|
||||
var pieces = key.split(/-(?!$)/);
|
||||
var lastPiece = pieces[pieces.length - 1];
|
||||
if (pieces.length == 1 && pieces[0].length == 1) {
|
||||
// No-modifier bindings use literal character bindings above. Skip.
|
||||
|
@ -1959,13 +1954,21 @@
|
|||
text = text.slice(0, - match[0].length);
|
||||
}
|
||||
}
|
||||
var wasLastLine = head.line - 1 == cm.lastLine();
|
||||
cm.replaceRange('', anchor, head);
|
||||
if (args.linewise && !wasLastLine) {
|
||||
var prevLineEnd = new Pos(anchor.line - 1, Number.MAX_VALUE);
|
||||
var wasLastLine = cm.firstLine() == cm.lastLine();
|
||||
if (head.line > cm.lastLine() && args.linewise && !wasLastLine) {
|
||||
cm.replaceRange('', prevLineEnd, head);
|
||||
} else {
|
||||
cm.replaceRange('', anchor, head);
|
||||
}
|
||||
if (args.linewise) {
|
||||
// Push the next line back down, if there is a next line.
|
||||
CodeMirror.commands.newlineAndIndent(cm);
|
||||
// null ch so setCursor moves to end of line.
|
||||
anchor.ch = null;
|
||||
if (!wasLastLine) {
|
||||
cm.setCursor(prevLineEnd);
|
||||
CodeMirror.commands.newlineAndIndent(cm);
|
||||
}
|
||||
// make sure cursor ends up at the end of the line.
|
||||
anchor.ch = Number.MAX_VALUE;
|
||||
}
|
||||
finalHead = anchor;
|
||||
} else {
|
||||
|
@ -2144,9 +2147,7 @@
|
|||
switch (actionArgs.position) {
|
||||
case 'center': y = y - (height / 2) + lineHeight;
|
||||
break;
|
||||
case 'bottom': y = y - height + lineHeight*1.4;
|
||||
break;
|
||||
case 'top': y = y + lineHeight*0.4;
|
||||
case 'bottom': y = y - height + lineHeight;
|
||||
break;
|
||||
}
|
||||
cm.scrollTo(null, y);
|
||||
|
@ -3208,7 +3209,7 @@
|
|||
return cur;
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* Returns the boundaries of the next word. If the cursor in the middle of
|
||||
* the word, then returns the boundaries of the current word, starting at
|
||||
* the cursor. If the cursor is at the start/end of a word, and we are going
|
||||
|
@ -4308,7 +4309,7 @@
|
|||
if (decimal + hex + octal > 1) { return 'Invalid arguments'; }
|
||||
number = decimal && 'decimal' || hex && 'hex' || octal && 'octal';
|
||||
}
|
||||
if (args.eatSpace() && args.match(/\/.*\//)) { 'patterns not supported'; }
|
||||
if (args.match(/\/.*\//)) { return 'patterns not supported'; }
|
||||
}
|
||||
}
|
||||
var err = parseArgs();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue