The plugin inverses the shift button when ARROW UP, ARROW DOWN or ENTER is pressed. This is to prevent arrow keys from browsing command history, but change line instead. Also it prevents the enter key from executing commands, but create new line instead. Hold SHIFT to achieve standard behaviour.
Command line interface
Syntax
The plugin is activated by entering a new line as the first character on a line (SHIFT+ENTER).
keyboard_multiline.js
- /**
- * If in a multiline statement, make new line on enter and change lines with arrows.
- * Then hold shift to browse command history or fire command.
- **/
- ts.onkeydown.push(function(e) {
- if (this.cursor_indexOf('\n') == 0) switch (e.key) {
- case 'enter':
- case 'up':
- case 'down':
- e.shift = !e.shift;
- break;
- }
- return true;
- });