InlineEdit: Add Sublime Text keymap

Sublime Text keymap has been available since CodeMirror 4.0. This change
enables using it in the EditScreen.

Change-Id: I34e82fceb9502405d8d03a6c6117d4900d08248e
This commit is contained in:
Michael Zhou
2016-04-18 15:53:55 -04:00
parent 05ac94d390
commit b72c03222c
4 changed files with 7 additions and 2 deletions

View File

@@ -1814,7 +1814,7 @@ CodeMirror themes are supported. Light themes `DEFAULT`, `ECLIPSE`,
`ELEGANT`, `NEAT`. Dark themes `MIDNIGHT`, `NIGHT`, `TWILIGHT`.
|`key_map_type` ||
The CodeMirror key map. Currently only a subset of key maps are
supported: `DEFAULT`, `EMACS`, `VIM`.
supported: `DEFAULT`, `EMACS`, `SUBLIME`, `VIM`.
|`tab_size` ||
Number of spaces that should be used to display one tab.
|`line_length` ||

View File

@@ -17,5 +17,6 @@ package com.google.gerrit.extensions.client;
public enum KeyMapType {
DEFAULT,
EMACS,
SUBLIME,
VIM
}

View File

@@ -321,6 +321,9 @@ public class EditPreferencesBox extends Composite {
keyMap.addItem(
KeyMapType.EMACS.name().toLowerCase(),
KeyMapType.EMACS.name());
keyMap.addItem(
KeyMapType.SUBLIME.name().toLowerCase(),
KeyMapType.SUBLIME.name());
keyMap.addItem(
KeyMapType.VIM.name().toLowerCase(),
KeyMapType.VIM.name());

View File

@@ -8,8 +8,9 @@ CM_CSS = [
CM_JS = [
'lib/codemirror.js',
'mode/meta.js',
'keymap/vim.js',
'keymap/emacs.js',
'keymap/sublime.js',
'keymap/vim.js',
]
CM_ADDONS = [