Skip to content

Commit

Permalink
implement persistent search
Browse files Browse the repository at this point in the history
  • Loading branch information
timsuchanek committed Apr 12, 2018
1 parent dbdec7a commit 4117245
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,9 @@ export class QueryEditor extends React.PureComponent<Props & ReduxProps, {}> {
'Ctrl-Right': 'goSubwordRight',
'Alt-Left': 'goGroupLeft',
'Alt-Right': 'goGroupRight',

'Cmd-F': 'findPersistent',
'Ctrl-F': 'findPersistent',
},
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ export class ResultViewer extends React.Component<Props, {}> {
require('codemirror/addon/fold/brace-fold')
require('codemirror/addon/dialog/dialog')
require('codemirror/addon/search/search')
require('codemirror/addon/search/searchcursor')
require('codemirror/addon/search/jump-to-line')
require('codemirror/keymap/sublime')
require('codemirror-graphql/results/mode')

Expand All @@ -61,6 +63,10 @@ export class ResultViewer extends React.Component<Props, {}> {
foldGutter,
gutters,
extraKeys: {
// Persistent search box in Query Editor
'Cmd-F': 'findPersistent',
'Ctrl-F': 'findPersistent',

// Editor improvements
'Ctrl-Left': 'goSubwordLeft',
'Ctrl-Right': 'goSubwordRight',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -990,8 +990,7 @@ div.CodeMirror-dragcursors {
}

.cm-searching {
background: #ffa;
background: rgba(255, 255, 0, 0.4);
background: rgba(255, 255, 255, 0.15);
}

/* IE7 hack to prevent it from returning funny offsetTops on the spans */
Expand Down Expand Up @@ -1045,7 +1044,7 @@ span.CodeMirror-selectedtext {
.CodeMirror-dialog input {
background: transparent;
border: 1px solid #d3d6db;
color: inherit;
color: rgba(255, 255, 255, 0.6);
font-family: monospace;
outline: none;
width: 20em;
Expand Down

0 comments on commit 4117245

Please sign in to comment.