Skip to content

Instantly share code, notes, and snippets.

@teramako
Created April 7, 2011 08:42
Show Gist options
  • Save teramako/907349 to your computer and use it in GitHub Desktop.
Save teramako/907349 to your computer and use it in GitHub Desktop.
[Vimperator]semiAutoComplete (テキトウにコードを書いていたらタブを押して初めて自動補完が有効になるコードとなった
let (cl = commandline) {
cl._autocompleteTimer = new Timer(200, 500, function autocompleteTell(tabPressed) {
if (events.feedingKeys || !options["autocomplete"])
return;
if (!this._completions && this._commandWidget.value.length >= 2) {
this._completions = CommandLine.Completions(this._commandWidget.inputField);
this._completions.complete(false, false);
}
let ctx = this._completions.context;
let argsContext = ctx.contexts["/ex/args"];
if (argsContext && argsContext.filter.length >= 3) {
this._completions.complete(true, false);
this._completions.itemList.show();
return;
}
//this.resetCompletions();
//this._completions = null;
this._completionList.hide();
}.bind(cl));
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment