Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/public/js/components/EditorSearchBar.js b/public/js/components/EditorSearchBar.js
- index 1b3a1ce..1444851 100644
- --- a/public/js/components/EditorSearchBar.js
- +++ b/public/js/components/EditorSearchBar.js
- @@ -47,6 +47,8 @@ const EditorSearchBar = React.createClass({
- componentDidMount() {
- const shortcuts = this.context.shortcuts;
- if (isEnabled("search")) {
- + shortcuts.on("CmdOrCtrl+g", this.searchNext);
- + shortcuts.on("CmdOrCtrl+shift+g", this.searchPrev); // i don't think this is right, but shortcuts is a library in devtools-modules that's easy to use
- shortcuts.on("CmdOrCtrl+F", this.toggleSearch);
- shortcuts.on("Escape", this.onEscape);
- }
- @@ -101,16 +103,24 @@ const EditorSearchBar = React.createClass({
- }
- if (e.shiftKey) {
- - findPrev(ctx, query);
- - const nextIndex = index == 0 ? count - 1 : index - 1;
- - this.setState({ index: nextIndex });
- + this.searchPrev();
- } else {
- - findNext(ctx, query);
- - const nextIndex = index == count - 1 ? 0 : index + 1;
- - this.setState({ index: nextIndex });
- + this.searchNext();
- }
- },
- + searchNext() {
- + findPrev(ctx, query);
- + const nextIndex = index == 0 ? count - 1 : index - 1;
- + this.setState({ index: nextIndex });
- + },
- +
- + searchPrev() {
- + findNext(ctx, query);
- + const nextIndex = index == count - 1 ? 0 : index + 1;
- + this.setState({ index: nextIndex });
- + },
- +
- renderSummary() {
- const { count, index, query } = this.state;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement