1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-22 16:57:57 +01:00

provide defaults for missing mode args to completion.{abbreviation,userMapping}

This commit is contained in:
Doug Kearns
2008-12-17 18:21:05 +11:00
parent 58514ffd4f
commit e6a15b1487

View File

@@ -1160,8 +1160,11 @@ function Completion() //{{{
////////////////////// COMPLETION TYPES //////////////////////////////////////// ////////////////////// COMPLETION TYPES ////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////{{{ /////////////////////////////////////////////////////////////////////////////{{{
// TODO: shouldn't all of these have a standard signature (context, args, ...)? --djk
abbreviation: function abbreviation(context, args, mode) abbreviation: function abbreviation(context, args, mode)
{ {
mode = mode || "!";
if (args.completeArg == 0) if (args.completeArg == 0)
{ {
let abbreviations = editor.getAbbreviations(mode); let abbreviations = editor.getAbbreviations(mode);
@@ -1682,6 +1685,9 @@ function Completion() //{{{
userMapping: function userMapping(context, args, modes) userMapping: function userMapping(context, args, modes)
{ {
// FIXME: have we decided on a 'standard' way to handle this clash? --djk
modes = modes || [modules.modes.NORMAL];
if (args.completeArg == 0) if (args.completeArg == 0)
{ {
let maps = [[m.names[0], ""] for (m in mappings.getUserIterator(modes))]; let maps = [[m.names[0], ""] for (m in mappings.getUserIterator(modes))];