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

Merge branch 'master' of kmaglione@git.vimperator.org:/git/vimperator/liberator

This commit is contained in:
Kris Maglione
2008-12-20 11:05:43 -05:00
5 changed files with 28 additions and 28 deletions

View File

@@ -59,7 +59,7 @@ Map.prototype = {
execute: function (motion, count, argument) execute: function (motion, count, argument)
{ {
var args = []; let args = [];
if (this.flags & Mappings.flags.MOTION) if (this.flags & Mappings.flags.MOTION)
args.push(motion); args.push(motion);
@@ -98,7 +98,7 @@ function Mappings() //{{{
function addMap(map, userMap) function addMap(map, userMap)
{ {
var where = userMap ? user : main; let where = userMap ? user : main;
map.modes.forEach(function (mode) { map.modes.forEach(function (mode) {
if (!(mode in where)) if (!(mode in where))
where[mode] = []; where[mode] = [];
@@ -108,7 +108,7 @@ function Mappings() //{{{
function getMap(mode, cmd, stack) function getMap(mode, cmd, stack)
{ {
var maps = stack[mode] || []; let maps = stack[mode] || [];
for (let [,map] in Iterator(maps)) for (let [,map] in Iterator(maps))
{ {
@@ -121,8 +121,8 @@ function Mappings() //{{{
function removeMap(mode, cmd) function removeMap(mode, cmd)
{ {
var maps = user[mode] || []; let maps = user[mode] || [];
var names; let names;
for (let [i, map] in Iterator(maps)) for (let [i, map] in Iterator(maps))
{ {
@@ -305,7 +305,7 @@ function Mappings() //{{{
addUserMap: function (modes, keys, description, action, extra) addUserMap: function (modes, keys, description, action, extra)
{ {
keys = keys.map(expandLeader); keys = keys.map(expandLeader);
var map = new Map(modes, keys, description || "User defined mapping", action, extra); let map = new Map(modes, keys, description || "User defined mapping", action, extra);
// remove all old mappings to this key sequence // remove all old mappings to this key sequence
for (let [,name] in Iterator(map.names)) for (let [,name] in Iterator(map.names))
@@ -353,7 +353,7 @@ function Mappings() //{{{
getMapLeader: function () getMapLeader: function ()
{ {
var leaderRef = liberator.variableReference("mapleader"); let leaderRef = liberator.variableReference("mapleader");
return leaderRef[0] ? leaderRef[0][leaderRef[1]] : "\\"; return leaderRef[0] ? leaderRef[0][leaderRef[1]] : "\\";
}, },

View File

@@ -54,13 +54,13 @@ const modes = (function () //{{{
return "-- PASS THROUGH --"; return "-- PASS THROUGH --";
// when recording a macro // when recording a macro
var macromode = ""; let macromode = "";
if (modes.isRecording) if (modes.isRecording)
macromode = "recording"; macromode = "recording";
else if (modes.isReplaying) else if (modes.isReplaying)
macromode = "replaying"; macromode = "replaying";
var ext = ""; let ext = "";
if (extended & modes.MENU) // TODO: desirable? if (extended & modes.MENU) // TODO: desirable?
ext += " (menu)"; ext += " (menu)";
ext += " --" + macromode; ext += " --" + macromode;
@@ -199,7 +199,7 @@ const modes = (function () //{{{
pop: function (silent) pop: function (silent)
{ {
var a = modeStack.pop(); let a = modeStack.pop();
if (a) if (a)
this.set(a[0], a[1], silent); this.set(a[0], a[1], silent);
else else

View File

@@ -117,7 +117,7 @@ Option.prototype = {
scope = this.scope; scope = this.scope;
} }
var aValue; let aValue;
if (liberator.has("tabs") && (scope & options.OPTION_SCOPE_LOCAL)) if (liberator.has("tabs") && (scope & options.OPTION_SCOPE_LOCAL))
aValue = tabs.options[this.name]; aValue = tabs.options[this.name];
@@ -334,7 +334,7 @@ function Options() //{{{
prefContexts[prefContexts.length - 1][name] = val; prefContexts[prefContexts.length - 1][name] = val;
} }
var type = prefService.getPrefType(name); let type = prefService.getPrefType(name);
switch (typeof value) switch (typeof value)
{ {
case "string": case "string":
@@ -439,7 +439,7 @@ function Options() //{{{
if (!args) if (!args)
{ {
var str = let str =
<table> <table>
{ {
template.map(liberator.globalVariables, function ([i, value]) { template.map(liberator.globalVariables, function ([i, value]) {
@@ -460,20 +460,20 @@ function Options() //{{{
return; return;
} }
var matches; let matches;
// 1 - type, 2 - name, 3 - +-., 4 - expr // 1 - type, 2 - name, 3 - +-., 4 - expr
if (matches = args.match(/([$@&])?([\w:]+)\s*([-+.])?=\s*(.+)/)) if (matches = args.match(/([$@&])?([\w:]+)\s*([-+.])?=\s*(.+)/))
{ {
if (!matches[1]) if (!matches[1])
{ {
var reference = liberator.variableReference(matches[2]); let reference = liberator.variableReference(matches[2]);
if (!reference[0] && matches[3]) if (!reference[0] && matches[3])
{ {
liberator.echoerr("E121: Undefined variable: " + matches[2]); liberator.echoerr("E121: Undefined variable: " + matches[2]);
return; return;
} }
var expr = liberator.evalExpression(matches[4]); let expr = liberator.evalExpression(matches[4]);
if (expr === undefined) if (expr === undefined)
{ {
liberator.echoerr("E15: Invalid expression: " + matches[4]); liberator.echoerr("E15: Invalid expression: " + matches[4]);
@@ -506,14 +506,14 @@ function Options() //{{{
// 1 - name // 1 - name
else if (matches = args.match(/^\s*([\w:]+)\s*$/)) else if (matches = args.match(/^\s*([\w:]+)\s*$/))
{ {
var reference = liberator.variableReference(matches[1]); let reference = liberator.variableReference(matches[1]);
if (!reference[0]) if (!reference[0])
{ {
liberator.echoerr("E121: Undefined variable: " + matches[1]); liberator.echoerr("E121: Undefined variable: " + matches[1]);
return; return;
} }
var value = reference[0][reference[1]]; let value = reference[0][reference[1]];
let prefix = typeof value == "number" ? "#" : let prefix = typeof value == "number" ? "#" :
typeof value == "function" ? "*" : typeof value == "function" ? "*" :
" "; " ";
@@ -567,9 +567,9 @@ function Options() //{{{
{ {
if (bang) if (bang)
{ {
var onlyNonDefault = false; let onlyNonDefault = false;
var reset = false; let reset = false;
var invertBoolean = false; let invertBoolean = false;
if (args[0] == "") if (args[0] == "")
{ {
@@ -685,7 +685,6 @@ function Options() //{{{
completer: function (context, args, modifiers) completer: function (context, args, modifiers)
{ {
let filter = context.filter; let filter = context.filter;
var optionCompletions = [];
if (args.bang) // list completions for about:config entries if (args.bang) // list completions for about:config entries
{ {
@@ -758,15 +757,15 @@ function Options() //{{{
"Delete a variable", "Delete a variable",
function (args) function (args)
{ {
//var names = args.split(/ /); //let names = args.split(/ /);
//if (typeof names == "string") names = [names]; //if (typeof names == "string") names = [names];
//var length = names.length; //let length = names.length;
//for (let i = 0, name = names[i]; i < length; name = names[++i]) //for (let i = 0, name = names[i]; i < length; name = names[++i])
for (let [,name] in args) for (let [,name] in args)
{ {
var name = args[i]; let name = args[i];
var reference = liberator.variableReference(name); let reference = liberator.variableReference(name);
if (!reference[0]) if (!reference[0])
{ {
if (!args.bang) if (!args.bang)
@@ -894,7 +893,7 @@ function Options() //{{{
if (!filter) if (!filter)
filter = ""; filter = "";
var prefArray = prefService.getChildList("", { value: 0 }); let prefArray = prefService.getChildList("", { value: 0 });
prefArray.sort(); prefArray.sort();
let prefs = function () { let prefs = function () {
for each (let pref in prefArray) for each (let pref in prefArray)

View File

@@ -809,7 +809,7 @@ function CommandLine() //{{{
command.description, command.description,
function (args) function (args)
{ {
var str = echoArgumentToString(args.string, true); let str = echoArgumentToString(args.string, true);
if (str != null) if (str != null)
command.action(str); command.action(str);
}, },

View File

@@ -20,6 +20,7 @@
* IMPORTANT: renamed Startup and Quit autocmd events to VimperatorEnter and * IMPORTANT: renamed Startup and Quit autocmd events to VimperatorEnter and
VimperatorLeave respectively VimperatorLeave respectively
* IMPORTANT: 'verbose' is now by default at 1, set to 0 to not show any status messages * IMPORTANT: 'verbose' is now by default at 1, set to 0 to not show any status messages
* IMPORTANT: option values containing whitespace must now be quoted E.g. :set editor=gvim\ -f
* :hardcopy now supports output redirection to a file on Unix and MacUnix * :hardcopy now supports output redirection to a file on Unix and MacUnix
* add ";f" extended hint mode to focus a frame * add ";f" extended hint mode to focus a frame