1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-20 12:17:59 +01:00

add abbreviation completion

This commit is contained in:
Doug Kearns
2008-12-13 01:05:45 +11:00
parent 05ac5cce49
commit e9c53d3776
3 changed files with 82 additions and 68 deletions

View File

@@ -517,7 +517,7 @@ CompletionContext.prototype = {
liberator.threadYield(false, interruptable);
return this.incomplete;
}
}
};
function Completion() //{{{
{
@@ -1161,6 +1161,15 @@ function Completion() //{{{
////////////////////// COMPLETION TYPES ////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////{{{
abbreviation: function abbreviation(context, args, mode)
{
if (args.completeArg == 0)
{
let abbreviations = editor.getAbbreviations(mode);
context.completions = [[lhs, ""] for ([, [, lhs,]] in Iterator(abbreviations))];
}
},
alternateStyleSheet: function alternateStylesheet(context)
{
context.title = ["Stylesheet", "Location"];
@@ -1683,7 +1692,7 @@ function Completion() //{{{
context.completions = maps;
}
}
// }}}
//}}}
};
const UrlCompleter = new Struct("name", "description", "completer");