aboutsummaryrefslogtreecommitdiff
path: root/src/actions
diff options
context:
space:
mode:
authorShin'ya Ueoka <ueokande@i-beam.org>2017-09-10 09:20:54 +0900
committerShin'ya Ueoka <ueokande@i-beam.org>2017-09-10 11:13:05 +0900
commit3c67cc0a002aded07e88ea25acc881ff080d1ae4 (patch)
treeed958c552d1b901d6dd104e73c579bb9c523779d /src/actions
parent7e35d11f659029febd738c83b19ab4b8a8b69642 (diff)
completion as action/reducer
Diffstat (limited to 'src/actions')
-rw-r--r--src/actions/background.js11
-rw-r--r--src/actions/index.js4
2 files changed, 14 insertions, 1 deletions
diff --git a/src/actions/background.js b/src/actions/background.js
new file mode 100644
index 0000000..40b901b
--- /dev/null
+++ b/src/actions/background.js
@@ -0,0 +1,11 @@
+import actions from '../actions';
+
+export function requestCompletions(line) {
+ let command = line.split(' ', 1)[0];
+ let keywords = line.replace(command + ' ', '');
+ return {
+ type: actions.BACKGROUND_REQUEST_COMPLETIONS,
+ command,
+ keywords
+ };
+}
diff --git a/src/actions/index.js b/src/actions/index.js
index 38ced9d..8f22193 100644
--- a/src/actions/index.js
+++ b/src/actions/index.js
@@ -2,5 +2,7 @@ export default {
CONSOLE_SHOW_COMMAND: 'vimvixen.console.show.command',
CONSOLE_SET_COMPLETIONS: 'vimvixen.console.set.completions',
CONSOLE_SHOW_ERROR: 'vimvixen.console.show.error',
- CONSOLE_HIDE: 'vimvixen.console.hide'
+ CONSOLE_HIDE: 'vimvixen.console.hide',
+
+ BACKGROUND_REQUEST_COMPLETIONS: 'vimvixen.background.request.completions'
};