fix completion

jh-changes
Shin'ya Ueoka 7 years ago
parent 73a4fe0bb1
commit ee9359c138
  1. 3
      src/background/index.js
  2. 9
      src/console/console.js
  3. 3
      src/console/console.scss

@ -90,7 +90,8 @@ browser.runtime.onMessage.addListener((request, sender) => {
return {
caption: tab.title,
content: tab.title,
url: tab.url
url: tab.url,
icon: tab.favIconUrl
}
});
return {

@ -43,7 +43,7 @@ const completeNext = () => {
}
let input = window.document.querySelector('#vimvixen-console-command-input');
input.value = completionOrigin + item.content;
input.value = completionOrigin + ' ' + item.content;
}
const completePrev = () => {
@ -56,7 +56,7 @@ const completePrev = () => {
}
let input = window.document.querySelector('#vimvixen-console-command-input');
input.value = completionOrigin + item.content;
input.value = completionOrigin + ' ' + item.content;
}
const handleKeydown = (e) => {
@ -80,6 +80,9 @@ const handleKeydown = (e) => {
};
const handleKeyup = (e) => {
if (e.keyCode === KeyboardEvent.DOM_VK_TAB) {
return;
}
if (e.target.value === prevValue) {
return;
}
@ -157,7 +160,7 @@ const setCompletions = (completions) => {
window.completion = new Completion(flatten);
let input = window.document.querySelector('#vimvixen-console-command-input');
completionOrigin = input.value;
completionOrigin = input.value.split(' ')[0];
}
messages.receive(window, (message) => {

@ -8,6 +8,7 @@ body {
bottom: 0;
left: 0;
right: 0;
overflow: hidden;
}
.vimvixen-console {
@ -38,7 +39,9 @@ body {
&-item {
padding-left: 1.5rem;
background-position: 0 center;
background-size: contain;
background-repeat: no-repeat;
white-space: nowrap;
&-caption {
display: inline-block;