mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-22 05:07:59 +01:00
move global completion functions into a vimperator.completion module
This commit is contained in:
@@ -257,7 +257,7 @@ function Buffer() //{{{
|
|||||||
if (!vimperator.bufferwindow.visible())
|
if (!vimperator.bufferwindow.visible())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
var items = get_buffer_completions("");
|
var items = vimperator.completion.get_buffer_completions("");
|
||||||
vimperator.bufferwindow.show(items);
|
vimperator.bufferwindow.show(items);
|
||||||
vimperator.bufferwindow.selectItem(getBrowser().mTabContainer.selectedIndex);
|
vimperator.bufferwindow.selectItem(getBrowser().mTabContainer.selectedIndex);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -323,7 +323,7 @@ function Commands() //{{{
|
|||||||
help: "Deletes <b>all</b> bookmarks which matches the url AND the specified tags. Use <code><Tab></code> key on a regular expression to complete the url which you want to delete.<br/>" +
|
help: "Deletes <b>all</b> bookmarks which matches the url AND the specified tags. Use <code><Tab></code> key on a regular expression to complete the url which you want to delete.<br/>" +
|
||||||
"The following options WILL be interpreted in the future:<br/>" +
|
"The following options WILL be interpreted in the future:<br/>" +
|
||||||
" -T comma,separated,tag,list <br/>",
|
" -T comma,separated,tag,list <br/>",
|
||||||
completer: function(filter) { return get_bookmark_completions(filter); }
|
completer: function(filter) { return vimperator.completion.get_bookmark_completions(filter); }
|
||||||
}
|
}
|
||||||
));
|
));
|
||||||
addDefaultCommand(new Command(["bookm[arks]", "bm"],
|
addDefaultCommand(new Command(["bookm[arks]", "bm"],
|
||||||
@@ -335,7 +335,7 @@ function Commands() //{{{
|
|||||||
"Close this window with <code class=\"command\">:pclose</code> or open entries with double click in the current tab or middle click in a new tab.<br/>" +
|
"Close this window with <code class=\"command\">:pclose</code> or open entries with double click in the current tab or middle click in a new tab.<br/>" +
|
||||||
"The following options WILL be interpreted in the future:<br/>" +
|
"The following options WILL be interpreted in the future:<br/>" +
|
||||||
" -T comma,separated,tag,list <br/>",
|
" -T comma,separated,tag,list <br/>",
|
||||||
completer: function(filter) { return get_bookmark_completions(filter); }
|
completer: function(filter) { return vimperator.completion.get_bookmark_completions(filter); }
|
||||||
}
|
}
|
||||||
));
|
));
|
||||||
addDefaultCommand(new Command(["b[uffer]"],
|
addDefaultCommand(new Command(["b[uffer]"],
|
||||||
@@ -356,7 +356,7 @@ function Commands() //{{{
|
|||||||
usage: ["b[uffer] {url|index}"],
|
usage: ["b[uffer] {url|index}"],
|
||||||
short_help: "Go to buffer from buffer list",
|
short_help: "Go to buffer from buffer list",
|
||||||
help: "Argument can be either the buffer index or the full URL.",
|
help: "Argument can be either the buffer index or the full URL.",
|
||||||
completer: function(filter) { return get_buffer_completions(filter); }
|
completer: function(filter) { return vimperator.completion.get_buffer_completions(filter); }
|
||||||
}
|
}
|
||||||
));
|
));
|
||||||
addDefaultCommand(new Command(["buffers", "files", "ls", "tabs"],
|
addDefaultCommand(new Command(["buffers", "files", "ls", "tabs"],
|
||||||
@@ -367,7 +367,7 @@ function Commands() //{{{
|
|||||||
vimperator.bufferwindow.hide();
|
vimperator.bufferwindow.hide();
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var items = get_buffer_completions("");
|
var items = vimperator.completion.get_buffer_completions("");
|
||||||
vimperator.bufferwindow.show(items);
|
vimperator.bufferwindow.show(items);
|
||||||
vimperator.bufferwindow.selectItem(getBrowser().mTabContainer.selectedIndex);
|
vimperator.bufferwindow.selectItem(getBrowser().mTabContainer.selectedIndex);
|
||||||
}
|
}
|
||||||
@@ -501,7 +501,7 @@ function Commands() //{{{
|
|||||||
"<li><code class=\"command\">:help o</code> for mappings (no pre- or postfix)</li>" +
|
"<li><code class=\"command\">:help o</code> for mappings (no pre- or postfix)</li>" +
|
||||||
"</ul>" +
|
"</ul>" +
|
||||||
"You can however use partial stings in the tab completion, so <code class=\"command\">:help he<Tab></code> will complete <code class=\"command\">:help :help</code>.",
|
"You can however use partial stings in the tab completion, so <code class=\"command\">:help he<Tab></code> will complete <code class=\"command\">:help :help</code>.",
|
||||||
completer: function(filter) { return get_help_completions(filter); }
|
completer: function(filter) { return vimperator.completion.get_help_completions(filter); }
|
||||||
}
|
}
|
||||||
));
|
));
|
||||||
addDefaultCommand(new Command(["hist[ory]", "hs"],
|
addDefaultCommand(new Command(["hist[ory]", "hs"],
|
||||||
@@ -511,7 +511,7 @@ function Commands() //{{{
|
|||||||
short_help: "Show recently visited URLs",
|
short_help: "Show recently visited URLs",
|
||||||
help: "Open the preview window at the bottom of the screen for all history items which match the filter string either in the title or URL. " +
|
help: "Open the preview window at the bottom of the screen for all history items which match the filter string either in the title or URL. " +
|
||||||
"Close this window with <code class=\"command\">:pclose</code> or open entries with double click in the current tab or middle click in a new tab.",
|
"Close this window with <code class=\"command\">:pclose</code> or open entries with double click in the current tab or middle click in a new tab.",
|
||||||
completer: function(filter) { return get_history_completions(filter); }
|
completer: function(filter) { return vimperator.completion.get_history_completions(filter); }
|
||||||
}
|
}
|
||||||
));
|
));
|
||||||
addDefaultCommand(new Command(["javas[cript]", "js"],
|
addDefaultCommand(new Command(["javas[cript]", "js"],
|
||||||
@@ -754,7 +754,7 @@ function Commands() //{{{
|
|||||||
"The items which are completed on <code><Tab></code> are specified in the <code class=\"option\">'complete'</code> option.<br/>" +
|
"The items which are completed on <code><Tab></code> are specified in the <code class=\"option\">'complete'</code> option.<br/>" +
|
||||||
"Without argument, reloads the current page.<br/>" +
|
"Without argument, reloads the current page.<br/>" +
|
||||||
"Without argument but with <code class=\"command\">!</code>, reloads the current page skipping the cache.",
|
"Without argument but with <code class=\"command\">!</code>, reloads the current page skipping the cache.",
|
||||||
completer: function(filter) { return get_url_completions(filter); }
|
completer: function(filter) { return vimperator.completion.get_url_completions(filter); }
|
||||||
}
|
}
|
||||||
));
|
));
|
||||||
addDefaultCommand(new Command(["pc[lose]"],
|
addDefaultCommand(new Command(["pc[lose]"],
|
||||||
@@ -937,7 +937,7 @@ function Commands() //{{{
|
|||||||
"<code class=\"command\">:set option?</code> or <code class=\"command\">:set option</code> shows the current value of the option.<br/>" +
|
"<code class=\"command\">:set option?</code> or <code class=\"command\">:set option</code> shows the current value of the option.<br/>" +
|
||||||
"<code class=\"command\">:set option&</code> resets 'option' to the default value.<br/>" +
|
"<code class=\"command\">:set option&</code> resets 'option' to the default value.<br/>" +
|
||||||
"<code class=\"command\">:set option+=foo</code> and <code class=\"command\">:set option-=foo</code> WILL add/remove foo from list options.<br/>",
|
"<code class=\"command\">:set option+=foo</code> and <code class=\"command\">:set option-=foo</code> WILL add/remove foo from list options.<br/>",
|
||||||
completer: function(filter) { return get_options_completions(filter); }
|
completer: function(filter) { return vimperator.completion.get_options_completions(filter); }
|
||||||
}
|
}
|
||||||
));
|
));
|
||||||
addDefaultCommand(new Command(["so[urce]"],
|
addDefaultCommand(new Command(["so[urce]"],
|
||||||
@@ -954,7 +954,7 @@ function Commands() //{{{
|
|||||||
"The .vimperatorrc file in your home directory and any files in ~/.vimperator/plugin/ are always sourced at startup.<br/>" +
|
"The .vimperatorrc file in your home directory and any files in ~/.vimperator/plugin/ are always sourced at startup.<br/>" +
|
||||||
"~ is supported as a shortcut for the $HOME directory.<br/>" +
|
"~ is supported as a shortcut for the $HOME directory.<br/>" +
|
||||||
"If <code class=\"command\">!</code> is specified, errors are not printed.",
|
"If <code class=\"command\">!</code> is specified, errors are not printed.",
|
||||||
completer: function(filter) { return get_file_completions(filter); }
|
completer: function(filter) { return vimperator.completion.get_file_completions(filter); }
|
||||||
}
|
}
|
||||||
));
|
));
|
||||||
addDefaultCommand(new Command(["st[op]"],
|
addDefaultCommand(new Command(["st[op]"],
|
||||||
@@ -971,7 +971,7 @@ function Commands() //{{{
|
|||||||
short_help: "Execute {cmd} and tell it to output in a new tab",
|
short_help: "Execute {cmd} and tell it to output in a new tab",
|
||||||
help: "Works for only commands that support it.<br/>" +
|
help: "Works for only commands that support it.<br/>" +
|
||||||
"Example: <code class=\"command\">:tab help tab</code> opens the help in a new tab.",
|
"Example: <code class=\"command\">:tab help tab</code> opens the help in a new tab.",
|
||||||
completer: function(filter) { return get_command_completions(filter); }
|
completer: function(filter) { return vimperator.completion.get_command_completions(filter); }
|
||||||
}
|
}
|
||||||
));
|
));
|
||||||
addDefaultCommand(new Command(["tabl[ast]"],
|
addDefaultCommand(new Command(["tabl[ast]"],
|
||||||
@@ -1019,7 +1019,7 @@ function Commands() //{{{
|
|||||||
short_help: "Open one or more URLs in a new tab",
|
short_help: "Open one or more URLs in a new tab",
|
||||||
help: "Like <code class=\"command\">:open</code> but open URLs in a new tab.<br/>" +
|
help: "Like <code class=\"command\">:open</code> but open URLs in a new tab.<br/>" +
|
||||||
"If used with <code class=\"command\">!</code>, the 'tabopen' value of the <code class=\"option\">'activate'</code> option is negated.",
|
"If used with <code class=\"command\">!</code>, the 'tabopen' value of the <code class=\"option\">'activate'</code> option is negated.",
|
||||||
completer: function(filter) { return get_url_completions(filter); }
|
completer: function(filter) { return vimperator.completion.get_url_completions(filter); }
|
||||||
}
|
}
|
||||||
));
|
));
|
||||||
addDefaultCommand(new Command(["tabp[revious]", "tp[revious]", "tabN[ext]", "tN[ext]"],
|
addDefaultCommand(new Command(["tabp[revious]", "tp[revious]", "tabN[ext]", "tN[ext]"],
|
||||||
|
|||||||
@@ -26,28 +26,11 @@ the provisions above, a recipient may use your version of this file under
|
|||||||
the terms of any one of the MPL, the GPL or the LGPL.
|
the terms of any one of the MPL, the GPL or the LGPL.
|
||||||
}}} ***** END LICENSE BLOCK *****/
|
}}} ***** END LICENSE BLOCK *****/
|
||||||
|
|
||||||
|
vimperator.completion = (function() // {{{
|
||||||
|
{
|
||||||
// The completion substrings, used for showing the longest common match
|
// The completion substrings, used for showing the longest common match
|
||||||
var g_substrings = [];
|
var g_substrings = [];
|
||||||
|
|
||||||
/*
|
|
||||||
* returns the longest common substring
|
|
||||||
* used for the 'longest' setting for wildmode
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
function get_longest_substring() //{{{
|
|
||||||
{
|
|
||||||
if (g_substrings.length == 0)
|
|
||||||
return '';
|
|
||||||
var longest = g_substrings[0];
|
|
||||||
for (var i = 1; i < g_substrings.length; i++)
|
|
||||||
{
|
|
||||||
if (g_substrings[i].length > longest.length)
|
|
||||||
longest = g_substrings[i];
|
|
||||||
}
|
|
||||||
//alert(longest);
|
|
||||||
return longest;
|
|
||||||
} //}}}
|
|
||||||
|
|
||||||
// function uses smartcase
|
// function uses smartcase
|
||||||
// list = [ [['com1', 'com2'], 'text'], [['com3', 'com4'], 'text'] ]
|
// list = [ [['com1', 'com2'], 'text'], [['com3', 'com4'], 'text'] ]
|
||||||
function build_longest_common_substring(list, filter) //{{{
|
function build_longest_common_substring(list, filter) //{{{
|
||||||
@@ -125,35 +108,6 @@ function build_longest_starting_substring(list, filter) //{{{
|
|||||||
return filtered;
|
return filtered;
|
||||||
} //}}}
|
} //}}}
|
||||||
|
|
||||||
/*
|
|
||||||
* filter a list of urls
|
|
||||||
*
|
|
||||||
* may consist of searchengines, filenames, bookmarks and history,
|
|
||||||
* depending on the 'complete' option
|
|
||||||
* if the 'complete' argument is passed like "h", it tempoarily overrides the complete option
|
|
||||||
*/
|
|
||||||
function get_url_completions(filter, complete) //{{{
|
|
||||||
{
|
|
||||||
var completions = new Array();
|
|
||||||
g_substrings = [];
|
|
||||||
|
|
||||||
var cpt = complete || vimperator.options["complete"];
|
|
||||||
// join all completion arrays together
|
|
||||||
for (var i = 0; i < cpt.length; i++)
|
|
||||||
{
|
|
||||||
if (cpt[i] == 's')
|
|
||||||
completions = completions.concat(get_search_completions(filter));
|
|
||||||
else if (cpt[i] == 'b')
|
|
||||||
completions = completions.concat(get_bookmark_completions(filter));
|
|
||||||
else if (cpt[i] == 'h')
|
|
||||||
completions = completions.concat(get_history_completions(filter));
|
|
||||||
else if (cpt[i] == 'f')
|
|
||||||
completions = completions.concat(get_file_completions(filter, true));
|
|
||||||
}
|
|
||||||
|
|
||||||
return completions;
|
|
||||||
} //}}}
|
|
||||||
|
|
||||||
/* discard all entries in the 'urls' array, which don't match 'filter */
|
/* discard all entries in the 'urls' array, which don't match 'filter */
|
||||||
function filter_url_array(urls, filter) //{{{
|
function filter_url_array(urls, filter) //{{{
|
||||||
{
|
{
|
||||||
@@ -214,7 +168,57 @@ function filter_url_array(urls, filter) //{{{
|
|||||||
return filtered.concat(additional_completions);
|
return filtered.concat(additional_completions);
|
||||||
} //}}}
|
} //}}}
|
||||||
|
|
||||||
function get_search_completions(filter) //{{{
|
return {
|
||||||
|
|
||||||
|
/*
|
||||||
|
* returns the longest common substring
|
||||||
|
* used for the 'longest' setting for wildmode
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
get_longest_substring: function() //{{{
|
||||||
|
{
|
||||||
|
if (g_substrings.length == 0)
|
||||||
|
return '';
|
||||||
|
var longest = g_substrings[0];
|
||||||
|
for (var i = 1; i < g_substrings.length; i++)
|
||||||
|
{
|
||||||
|
if (g_substrings[i].length > longest.length)
|
||||||
|
longest = g_substrings[i];
|
||||||
|
}
|
||||||
|
//alert(longest);
|
||||||
|
return longest;
|
||||||
|
}, //}}}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* filter a list of urls
|
||||||
|
*
|
||||||
|
* may consist of searchengines, filenames, bookmarks and history,
|
||||||
|
* depending on the 'complete' option
|
||||||
|
* if the 'complete' argument is passed like "h", it temporarily overrides the complete option
|
||||||
|
*/
|
||||||
|
get_url_completions: function(filter, complete) //{{{
|
||||||
|
{
|
||||||
|
var completions = new Array();
|
||||||
|
g_substrings = [];
|
||||||
|
|
||||||
|
var cpt = complete || vimperator.options["complete"];
|
||||||
|
// join all completion arrays together
|
||||||
|
for (var i = 0; i < cpt.length; i++)
|
||||||
|
{
|
||||||
|
if (cpt[i] == 's')
|
||||||
|
completions = completions.concat(this.get_search_completions(filter));
|
||||||
|
else if (cpt[i] == 'b')
|
||||||
|
completions = completions.concat(this.get_bookmark_completions(filter));
|
||||||
|
else if (cpt[i] == 'h')
|
||||||
|
completions = completions.concat(this.get_history_completions(filter));
|
||||||
|
else if (cpt[i] == 'f')
|
||||||
|
completions = completions.concat(this.get_file_completions(filter, true));
|
||||||
|
}
|
||||||
|
|
||||||
|
return completions;
|
||||||
|
}, //}}}
|
||||||
|
|
||||||
|
get_search_completions: function(filter) //{{{
|
||||||
{
|
{
|
||||||
var engines = vimperator.bookmarks.getSearchEngines().concat(vimperator.bookmarks.getKeywords());
|
var engines = vimperator.bookmarks.getSearchEngines().concat(vimperator.bookmarks.getKeywords());
|
||||||
|
|
||||||
@@ -225,21 +229,21 @@ function get_search_completions(filter) //{{{
|
|||||||
return [[$_[0]], $_[1]];
|
return [[$_[0]], $_[1]];
|
||||||
});
|
});
|
||||||
return build_longest_common_substring(mapped, filter);
|
return build_longest_common_substring(mapped, filter);
|
||||||
} //}}}
|
}, //}}}
|
||||||
|
|
||||||
function get_history_completions(filter) //{{{
|
get_history_completions: function(filter) //{{{
|
||||||
{
|
{
|
||||||
var items = vimperator.history.get();
|
var items = vimperator.history.get();
|
||||||
return filter_url_array(items, filter);
|
return filter_url_array(items, filter);
|
||||||
} //}}}
|
}, //}}}
|
||||||
|
|
||||||
function get_bookmark_completions(filter) //{{{
|
get_bookmark_completions: function(filter) //{{{
|
||||||
{
|
{
|
||||||
var bookmarks = vimperator.bookmarks.get();
|
var bookmarks = vimperator.bookmarks.get();
|
||||||
return filter_url_array(bookmarks, filter);
|
return filter_url_array(bookmarks, filter);
|
||||||
} //}}}
|
}, //}}}
|
||||||
|
|
||||||
function get_file_completions(filter) //{{{
|
get_file_completions: function(filter) //{{{
|
||||||
{
|
{
|
||||||
//var completions = new Array();
|
//var completions = new Array();
|
||||||
/* This is now also used as part of the url completion, so the substrings shouldn't be cleared for that case */
|
/* This is now also used as part of the url completion, so the substrings shouldn't be cleared for that case */
|
||||||
@@ -278,9 +282,9 @@ function get_file_completions(filter) //{{{
|
|||||||
});
|
});
|
||||||
|
|
||||||
return build_longest_starting_substring(mapped, new_filter);
|
return build_longest_starting_substring(mapped, new_filter);
|
||||||
} //}}}
|
}, //}}}
|
||||||
|
|
||||||
function get_help_completions(filter) //{{{
|
get_help_completions: function(filter) //{{{
|
||||||
{
|
{
|
||||||
var help_array = [[["introduction"], "Introductory text"],
|
var help_array = [[["introduction"], "Introductory text"],
|
||||||
[["mappings"], "Normal mode commands"],
|
[["mappings"], "Normal mode commands"],
|
||||||
@@ -294,7 +298,7 @@ function get_help_completions(filter) //{{{
|
|||||||
}),
|
}),
|
||||||
command.short_help])
|
command.short_help])
|
||||||
}
|
}
|
||||||
options = get_options_completions(filter, true);
|
options = this.get_options_completions(filter, true);
|
||||||
help_array = help_array.concat(options.map(function($_) {
|
help_array = help_array.concat(options.map(function($_) {
|
||||||
return [
|
return [
|
||||||
$_[0].map(function($_) { return "'" + $_ + "'"; }),
|
$_[0].map(function($_) { return "'" + $_ + "'"; }),
|
||||||
@@ -309,9 +313,9 @@ function get_help_completions(filter) //{{{
|
|||||||
});
|
});
|
||||||
|
|
||||||
return build_longest_common_substring(help_array, filter);
|
return build_longest_common_substring(help_array, filter);
|
||||||
} //}}}
|
}, //}}}
|
||||||
|
|
||||||
function get_command_completions(filter) //{{{
|
get_command_completions: function(filter) //{{{
|
||||||
{
|
{
|
||||||
//g_completions = [];
|
//g_completions = [];
|
||||||
g_substrings = [];
|
g_substrings = [];
|
||||||
@@ -326,9 +330,9 @@ function get_command_completions(filter) //{{{
|
|||||||
for (var command in vimperator.commands)
|
for (var command in vimperator.commands)
|
||||||
completions.push([command.long_names, command.short_help]);
|
completions.push([command.long_names, command.short_help]);
|
||||||
return build_longest_starting_substring(completions, filter);
|
return build_longest_starting_substring(completions, filter);
|
||||||
} //}}}
|
}, //}}}
|
||||||
|
|
||||||
function get_options_completions(filter, unfiltered) //{{{
|
get_options_completions: function(filter, unfiltered) //{{{
|
||||||
{
|
{
|
||||||
g_substrings = [];
|
g_substrings = [];
|
||||||
var options_completions = [];
|
var options_completions = [];
|
||||||
@@ -408,9 +412,9 @@ function get_options_completions(filter, unfiltered) //{{{
|
|||||||
}
|
}
|
||||||
|
|
||||||
return options_completions;
|
return options_completions;
|
||||||
} //}}}
|
}, //}}}
|
||||||
|
|
||||||
function get_buffer_completions(filter) //{{{
|
get_buffer_completions: function(filter) //{{{
|
||||||
{
|
{
|
||||||
g_substrings = [];
|
g_substrings = [];
|
||||||
var items = [];
|
var items = [];
|
||||||
@@ -444,9 +448,9 @@ function get_buffer_completions(filter) //{{{
|
|||||||
return [$_[0][0], $_[1]];
|
return [$_[0][0], $_[1]];
|
||||||
});
|
});
|
||||||
return build_longest_common_substring(items, filter);
|
return build_longest_common_substring(items, filter);
|
||||||
} //}}}
|
}, //}}}
|
||||||
|
|
||||||
function exTabCompletion(str) //{{{
|
exTabCompletion: function(str) //{{{
|
||||||
{
|
{
|
||||||
var [count, cmd, special, args] = vimperator.commands.parseCommand(str);
|
var [count, cmd, special, args] = vimperator.commands.parseCommand(str);
|
||||||
var completions = new Array;
|
var completions = new Array;
|
||||||
@@ -457,7 +461,7 @@ function exTabCompletion(str) //{{{
|
|||||||
var matches = str.match(/^(:*\d*)\w*$/);
|
var matches = str.match(/^(:*\d*)\w*$/);
|
||||||
if(matches)
|
if(matches)
|
||||||
{
|
{
|
||||||
completions = get_command_completions(cmd);
|
completions = this.get_command_completions(cmd);
|
||||||
start = matches[1].length;
|
start = matches[1].length;
|
||||||
}
|
}
|
||||||
else // dynamically get completions as specified with the command's completer function
|
else // dynamically get completions as specified with the command's completer function
|
||||||
@@ -478,4 +482,7 @@ function exTabCompletion(str) //{{{
|
|||||||
return [start, completions];
|
return [start, completions];
|
||||||
} //}}}
|
} //}}}
|
||||||
|
|
||||||
|
}
|
||||||
|
})(); // }}}
|
||||||
|
|
||||||
// vim: set fdm=marker sw=4 ts=4 et:
|
// vim: set fdm=marker sw=4 ts=4 et:
|
||||||
|
|||||||
@@ -491,7 +491,7 @@ function CommandLine() //{{{
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (longest && completions.length > 1)
|
if (longest && completions.length > 1)
|
||||||
var compl = get_longest_substring();
|
var compl = vimperator.completion.get_longest_substring();
|
||||||
else if (full)
|
else if (full)
|
||||||
var compl = completions[completion_index][0];
|
var compl = completions[completion_index][0];
|
||||||
else if (completions.length == 1)
|
else if (completions.length == 1)
|
||||||
|
|||||||
@@ -532,7 +532,7 @@ const vimperator = (function() //{{{
|
|||||||
|
|
||||||
// TODO: move elsewhere
|
// TODO: move elsewhere
|
||||||
vimperator.registerCallback("submit", vimperator.modes.EX, function(command) { vimperator.execute(command); } );
|
vimperator.registerCallback("submit", vimperator.modes.EX, function(command) { vimperator.execute(command); } );
|
||||||
vimperator.registerCallback("complete", vimperator.modes.EX, function(str) { return exTabCompletion(str); } );
|
vimperator.registerCallback("complete", vimperator.modes.EX, function(str) { return vimperator.completion.exTabCompletion(str); } );
|
||||||
|
|
||||||
// first time intro message
|
// first time intro message
|
||||||
if (Options.getPref("firsttime", true))
|
if (Options.getPref("firsttime", true))
|
||||||
|
|||||||
Reference in New Issue
Block a user