aboutsummaryrefslogtreecommitdiff
path: root/src/console/reducers
diff options
context:
space:
mode:
authorShin'ya Ueoka <ueokande@i-beam.org>2017-11-06 20:13:15 +0900
committerShin'ya Ueoka <ueokande@i-beam.org>2017-11-11 16:16:01 +0900
commitbe37c42d28e4d32609b5972ee937a269d18c0f67 (patch)
tree8b811c3dccd38292e8ecc14d0108a6352476a4f4 /src/console/reducers
parentcb4b26e03f97ff2f1789f7a59efe2973ab1d0eb9 (diff)
show find in console
Diffstat (limited to 'src/console/reducers')
-rw-r--r--src/console/reducers/index.js13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/console/reducers/index.js b/src/console/reducers/index.js
index d4affa7..d94662b 100644
--- a/src/console/reducers/index.js
+++ b/src/console/reducers/index.js
@@ -3,7 +3,7 @@ import actions from 'console/actions';
const defaultState = {
mode: '',
messageText: '',
- commandText: '',
+ consoleText: '',
completions: [],
groupSelection: -1,
itemSelection: -1,
@@ -48,8 +48,13 @@ export default function reducer(state = defaultState, action = {}) {
case actions.CONSOLE_SHOW_COMMAND:
return Object.assign({}, state, {
mode: 'command',
- commandText: action.text,
- errorShown: false,
+ consoleText: action.text,
+ completions: []
+ });
+ case actions.CONSOLE_SHOW_FIND:
+ return Object.assign({}, state, {
+ mode: 'find',
+ consoleText: '',
completions: []
});
case actions.CONSOLE_SHOW_ERROR:
@@ -64,7 +69,7 @@ export default function reducer(state = defaultState, action = {}) {
});
case actions.CONSOLE_HIDE_COMMAND:
return Object.assign({}, state, {
- mode: state.mode === 'command' ? '' : state.mode,
+ mode: state.mode === 'command' || state.mode === 'find' ? '' : state.mode,
});
case actions.CONSOLE_SET_COMPLETIONS:
return Object.assign({}, state, {