Add keybinding selection to textarea bookmarklet
This commit is contained in:
parent
67880a49bd
commit
bd2e5381cc
1 changed files with 20 additions and 0 deletions
|
|
@ -324,6 +324,19 @@ function setupApi(editor, editorDiv, settingDiv, ace, options, loader) {
|
|||
editorDiv.style.fontSize = value;
|
||||
break;
|
||||
|
||||
case "keybindings":
|
||||
switch (value) {
|
||||
case "vim":
|
||||
editor.setKeyboardHandler(require("ace/keyboard/vim").handler);
|
||||
break;
|
||||
case "emacs":
|
||||
editor.setKeyboardHandler(require("ace/keyboard/emacs").handler);
|
||||
break;
|
||||
default:
|
||||
editor.setKeyboardHandler(null);
|
||||
}
|
||||
break;
|
||||
|
||||
case "softWrap":
|
||||
switch (value) {
|
||||
case "off":
|
||||
|
|
@ -391,6 +404,7 @@ function setupSettingPanel(settingDiv, settingOpener, editor, options) {
|
|||
theme: "Theme:",
|
||||
fontSize: "Font Size:",
|
||||
softWrap: "Soft Wrap:",
|
||||
keybindings: "Keyboard",
|
||||
showPrintMargin: "Show Print Margin:",
|
||||
useSoftTabs: "Use Soft Tabs:",
|
||||
showInvisibles: "Show Invisibles"
|
||||
|
|
@ -456,6 +470,11 @@ function setupSettingPanel(settingDiv, settingOpener, editor, options) {
|
|||
80: "80",
|
||||
free: "Free"
|
||||
},
|
||||
keybindings: {
|
||||
ace: "ace",
|
||||
vim: "vim",
|
||||
emacs: "emacs"
|
||||
},
|
||||
showPrintMargin: BOOL,
|
||||
useSoftTabs: BOOL,
|
||||
showInvisibles: BOOL
|
||||
|
|
@ -518,6 +537,7 @@ exports.options = {
|
|||
gutter: "false",
|
||||
fontSize: "12px",
|
||||
softWrap: "off",
|
||||
keybindings: "ace",
|
||||
showPrintMargin: "false",
|
||||
useSoftTabs: "true",
|
||||
showInvisibles: "true"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue