mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-20 12:38:00 +01:00
Allow using heredocs with :abbr/:au/:com/:map.
This commit is contained in:
@@ -247,19 +247,20 @@ var Abbreviations = Module("abbreviations", {
|
|||||||
abbreviations.add(modes, lhs, rhs);
|
abbreviations.add(modes, lhs, rhs);
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
options: [
|
|
||||||
{
|
|
||||||
names: ["-javascript", "-js", "-j"],
|
|
||||||
description: "Expand this abbreviation by evaluating its right-hand-side as JavaScript"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
completer: function (context, args) {
|
completer: function (context, args) {
|
||||||
if (args.length == 1)
|
if (args.length == 1)
|
||||||
return completion.abbreviation(context, modes);
|
return completion.abbreviation(context, modes);
|
||||||
else if (args["-javascript"])
|
else if (args["-javascript"])
|
||||||
return completion.javascript(context);
|
return completion.javascript(context);
|
||||||
},
|
},
|
||||||
|
hereDoc: true,
|
||||||
literal: 1,
|
literal: 1,
|
||||||
|
options: [
|
||||||
|
{
|
||||||
|
names: ["-javascript", "-js", "-j"],
|
||||||
|
description: "Expand this abbreviation by evaluating its right-hand-side as JavaScript"
|
||||||
|
}
|
||||||
|
],
|
||||||
serialize: function () [
|
serialize: function () [
|
||||||
{
|
{
|
||||||
command: this.name,
|
command: this.name,
|
||||||
|
|||||||
@@ -178,6 +178,7 @@ var AutoCommands = Module("autocommands", {
|
|||||||
if (args.length == 3)
|
if (args.length == 3)
|
||||||
return args["-javascript"] ? completion.javascript(context) : completion.ex(context);
|
return args["-javascript"] ? completion.javascript(context) : completion.ex(context);
|
||||||
},
|
},
|
||||||
|
hereDoc: true,
|
||||||
literal: 2,
|
literal: 2,
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1365,6 +1365,7 @@ var Commands = Module("commands", {
|
|||||||
else
|
else
|
||||||
args["-javascript"] ? completion.javascript(context) : completion.ex(context);
|
args["-javascript"] ? completion.javascript(context) : completion.ex(context);
|
||||||
},
|
},
|
||||||
|
hereDoc: true,
|
||||||
options: [
|
options: [
|
||||||
{ names: ["-bang", "-b"], description: "Command may be followed by a !" },
|
{ names: ["-bang", "-b"], description: "Command may be followed by a !" },
|
||||||
{ names: ["-count", "-c"], description: "Command may be preceded by a count" },
|
{ names: ["-count", "-c"], description: "Command may be preceded by a count" },
|
||||||
|
|||||||
@@ -389,6 +389,7 @@ var Mappings = Module("mappings", {
|
|||||||
return completion.ex(context);
|
return completion.ex(context);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
hereDoc: true,
|
||||||
literal: 1,
|
literal: 1,
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user