Enable persistent search box

This commit is contained in:
Gregory Schier 2017-08-01 14:39:54 -07:00
parent 6bf2e1652a
commit fb675159bd

View File

@ -12,7 +12,7 @@ import FilterHelpModal from '../modals/filter-help-modal';
import * as misc from '../../../common/misc'; import * as misc from '../../../common/misc';
import {trackEvent} from '../../../analytics/index'; import {trackEvent} from '../../../analytics/index';
import {prettifyJson} from '../../../common/prettify'; import {prettifyJson} from '../../../common/prettify';
import {DEBOUNCE_MILLIS} from '../../../common/constants'; import {DEBOUNCE_MILLIS, isMac} from '../../../common/constants';
import './base-imports'; import './base-imports';
import {getTagDefinitions} from '../../../templating/index'; import {getTagDefinitions} from '../../../templating/index';
import Dropdown from '../base/dropdown/dropdown'; import Dropdown from '../base/dropdown/dropdown';
@ -45,10 +45,14 @@ const BASE_CODEMIRROR_OPTIONS = {
cursorScrollMargin: 12, // NOTE: This is px cursorScrollMargin: 12, // NOTE: This is px
keyMap: 'default', keyMap: 'default',
extraKeys: { extraKeys: {
'Ctrl-Space': 'autocomplete',
'Ctrl-Q': function (cm) { 'Ctrl-Q': function (cm) {
cm.foldCode(cm.getCursor()); cm.foldCode(cm.getCursor());
} },
'Ctrl-Space': 'autocomplete',
// Change default find command from "find" to "findPersistent" so the
// search box stays open after pressing Enter
[isMac() ? 'Cmd-F' : 'Ctrl-F']: 'findPersistent'
} }
}; };