aboutsummaryrefslogtreecommitdiff
path: root/src/pages
diff options
context:
space:
mode:
authorShin'ya Ueoka <ueokande@i-beam.org>2017-10-01 08:57:20 +0900
committerShin'ya Ueoka <ueokande@i-beam.org>2017-10-01 08:57:20 +0900
commit749eea5ecfd5b04547350820122ae7d491631577 (patch)
tree349691b7671c6f10a568df709dc8130877b353f9 /src/pages
parent40cc5b9175f08f66c9c6a9d6efad59bf47cea307 (diff)
completion in background
Diffstat (limited to 'src/pages')
-rw-r--r--src/pages/console.js11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/pages/console.js b/src/pages/console.js
index 40e713e..1e1b3fd 100644
--- a/src/pages/console.js
+++ b/src/pages/console.js
@@ -26,9 +26,9 @@ completionStore.subscribe(() => {
if (state.groupSelection >= 0) {
let item = state.groups[state.groupSelection].items[state.itemSelection];
- input.value = completionOrigin + ' ' + item.content;
+ input.value = item.content;
} else if (state.groups.length > 0) {
- input.value = completionOrigin + ' ';
+ input.value = completionOrigin;
}
});
@@ -68,6 +68,10 @@ const handleKeyup = (e) => {
if (e.target.value === prevValue) {
return;
}
+
+ let input = window.document.querySelector('#vimvixen-console-command-input');
+ completionOrigin = input.value;
+
prevValue = e.target.value;
return browser.runtime.sendMessage({
type: messages.CONSOLE_CHANGEED,
@@ -84,9 +88,6 @@ window.addEventListener('load', () => {
const updateCompletions = (completions) => {
completionStore.dispatch(completionActions.setItems(completions));
-
- let input = window.document.querySelector('#vimvixen-console-command-input');
- completionOrigin = input.value.split(' ')[0];
};
const update = (state) => {