Skip to content

Commit c908282

Browse files
committed
[#1867] Fix default color bug, add to keyboard shortcuts
1 parent 4c3ef72 commit c908282

File tree

4 files changed

+3543
-3008
lines changed

4 files changed

+3543
-3008
lines changed

client/modules/IDE/components/Editor.jsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,11 @@ class Editor extends React.Component {
155155
[`${metaKey}-G`]: 'findPersistentNext',
156156
[`Shift-${metaKey}-G`]: 'findPersistentPrev',
157157
[replaceCommand]: 'replace',
158-
[`${metaKey}-K`]: (cm, event) => cm.state.colorpicker.popup_color_picker()
158+
// Cassie Tarakajian: If you don't set a default color, then when you
159+
// choose a color, it deletes characters inline. This is a
160+
// hack to prevent that.
161+
[`${metaKey}-K`]: (cm, event) =>
162+
cm.state.colorpicker.popup_color_picker({ length: 0 })
159163
});
160164

161165
this.initializeDocuments(this.props.files);

client/modules/IDE/components/KeyboardShortcutModal.jsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ function KeyboardShortcutModal() {
6161
<span className="keyboard-shortcut__command">{metaKeyName} + /</span>
6262
<span>{t('KeyboardShortcuts.CodeEditing.CommentLine')}</span>
6363
</li>
64+
<li className="keyboard-shortcut-item">
65+
<span className="keyboard-shortcut__command">{metaKeyName} + K</span>
66+
<span>{t('KeyboardShortcuts.CodeEditing.ColorPicker')}</span>
67+
</li>
6468
</ul>
6569
<h3 className="keyboard-shortcuts__title">General</h3>
6670
<ul className="keyboard-shortcuts__list">

0 commit comments

Comments
 (0)