diff --git a/.gitignore b/.gitignore
index 70f6032d..50e5bc77 100644
--- a/.gitignore
+++ b/.gitignore
@@ -8,6 +8,7 @@
*.xpi
*/locale/*/*.html
*/chrome
+*/contrib/vim/*.vba
## Editor backup and swap files
*~
@@ -28,4 +29,4 @@
## Generated by StGit
patches-*
-.stgit-edit.txt
+.stgit-*.txt
diff --git a/Makefile b/Makefile
index 2d0618d6..c0c3842b 100644
--- a/Makefile
+++ b/Makefile
@@ -3,8 +3,12 @@ DIRS = vimperator muttator
TARGETS = clean distclean doc help info jar release xpi
.SILENT:
+all: xpi ;
+
$(TARGETS:%=\%.%):
echo MAKE $@
$(MAKE) -C $* $(@:$*.%=%)
-$(TARGETS): %: $(DIRS:%=%.%)
+$(TARGETS):
+ $(MAKE) $(DIRS:%=%.$@)
+
diff --git a/common/Makefile.common b/common/Makefile.common
index 38606885..c1458a87 100644
--- a/common/Makefile.common
+++ b/common/Makefile.common
@@ -3,10 +3,11 @@
TOP = $(shell pwd)
OS = $(shell uname -s)
BUILD_DATE = $(shell date "+%Y/%m/%d %H:%M:%S")
-BASE = $(TOP)/../common
+BASE = $(TOP)/../common
-DOC_SRC_FILES = $(wildcard locale/*/*.txt) $(wildcard locale/*/*.t2t)
-LOCALES = $(wildcard locale/*)
+LOCALEDIR = locale
+DOC_SRC_FILES = $(wildcard $(LOCALEDIR)/*/*.txt)
+LOCALES = $(foreach locale,$(wildcard $(LOCALEDIR)/*),$(word 2,$(subst /, ,$(locale))))
MAKE_JAR = VERSION="$(VERSION)" DATE="$(BUILD_DATE)" sh $(BASE)/make_jar.sh
@@ -16,7 +17,7 @@ JAR_DIRS = content skin locale
JAR_TEXTS = js css dtd xml xul html xhtml
JAR_BINS = png
-JAR = chrome/${NAME}.jar
+JAR = chrome/$(NAME).jar
XPI_BASES = $(JAR_BASES) $(TOP)/..
XPI_FILES = install.rdf TODO AUTHORS Donators NEWS License.txt
@@ -24,32 +25,38 @@ XPI_DIRS = modules components chrome
XPI_TEXTS = js jsm
XPI_BINS = jar
-XPI_NAME = ${NAME}_${VERSION}
-XPI_PATH = ../downloads/${XPI_NAME}
-XPI = $(XPI_PATH).xpi
+XPI_NAME = $(NAME)_$(VERSION)
+XPI_PATH = ../downloads/$(XPI_NAME)
+XPI = $(XPI_PATH).xpi
RDF = ../downloads/update.rdf
-RDF_IN = ${RDF}.in
+RDF_IN = $(RDF).in
-BUILD_DIR = build.${VERSION}.${OS}
+BUILD_DIR = build.$(VERSION).$(OS)
ASCIIDOC = asciidoc
+AWK = awk
.SILENT:
#### rules
-.PHONY: all help info doc jar xpi install clean distclean $(JAR)
+TARGETS = all help info doc jar xpi install clean distclean $(JAR)
+$(TARGETS:%=\%.%):
+ echo MAKE $* $(@:$*.%=%)
+ $(MAKE) -C $* $(@:$*.%=%)
+
+.PHONY: $(TARGETS)
all: help
help:
- @echo "${NAME} ${VERSION} build"
+ @echo "$(NAME) $(VERSION) build"
@echo
@echo " make help - display this help"
@echo " make info - show some info about the system"
@echo " make doc - build doc files"
- @echo " make jar - build a JAR (${JAR})"
- @echo " make xpi - build an XPI (${XPI_NAME})"
+ @echo " make jar - build a JAR ($(JAR))"
+ @echo " make xpi - build an XPI ($(XPI_NAME))"
@echo " make release - updates update.rdf (this is not for you)"
@echo " make clean - clean up"
@echo " make distclean - clean up more"
@@ -57,39 +64,37 @@ help:
@echo "running some commands with V=1 will show more build details"
info:
- @echo "version ${VERSION}"
- @echo "release file ${XPI}"
- @echo "doc files ${DOC_SRC_FILES}"
- @echo -e "jar files $(shell echo ${JAR_FILES} | sed 's/ /\\n /g' )"
- @echo "xpi files ${XPI_FILES}"
+ @echo "version $(VERSION)"
+ @echo "release file $(XPI)"
+ @echo "doc files $(DOC_SRC_FILES)"
+ @echo "xpi files $(XPI_FILES)"
-xpi: ${XPI}
-jar: ${JAR}
+xpi: $(XPI)
+jar: $(JAR)
-release: ${XPI} ${RDF}
+release: $(XPI) $(RDF)
-${RDF}: ${RDF_IN} Makefile
+$(RDF): $(RDF_IN) Makefile
@echo "Preparing release..."
- ${Q}${SED} -e "s,###VERSION###,${VERSION},g" \
- -e "s,###DATE###,${BUILD_DATE},g" \
+ $(SED) -e "s,###VERSION###,$(VERSION),g" \
+ -e "s,###DATE###,$(BUILD_DATE),g" \
< $< > $@
@echo "SUCCESS: $@"
-clean:
- @echo "Cleanup..."
- rm -f ${JAR} ${XPI}
+clean: $(LOCALEDIR)/$(LOCALES:%=%.clean)
+ @echo "General $(NAME) cleanup..."
+ rm -f $(JAR) $(XPI)
-distclean: clean
- @echo "More cleanup..."
- @set -e; for locale in $(LOCALES); do $(MAKE) -C clean; doc; done
- rm -rf ${BUILD_DIR}
+distclean: $(LOCALEDIR)/$(LOCALES:%=%.distclean) clean
+ @echo "More $(NAME) cleanup..."
+ rm -rf $(BUILD_DIR)
#### xpi
$(XPI): $(JAR)
@echo "Building XPI..."
mkdir -p $(XPI_PATH)
- awk -v 'name=$(NAME)' -f $(BASE)/process_manifest.awk $(TOP)/chrome.manifest >$(XPI_PATH)/chrome.manifest
+ $(AWK) -v 'name=$(NAME)' -f $(BASE)/process_manifest.awk $(TOP)/chrome.manifest >$(XPI_PATH)/chrome.manifest
$(MAKE_JAR) "$(XPI)" "$(XPI_BASES)" "$(XPI_DIRS)" "$(XPI_TEXTS)" "$(XPI_BINS)" "$(XPI_FILES)"
@echo "SUCCESS: $@"
@@ -102,5 +107,4 @@ $(JAR): doc
#### doc (see Makefile.doc)
-doc:
- @set -e; for locale in $(LOCALES); do $(MAKE) -C $$locale doc; done
+doc: $(foreach localetgt,$(LOCALES:%=%.doc),$(addprefix $(LOCALEDIR)/,$(localetgt))) ;
diff --git a/common/Makefile.doc b/common/Makefile.doc
index 7111a941..9fed1d5e 100644
--- a/common/Makefile.doc
+++ b/common/Makefile.doc
@@ -1,28 +1,18 @@
-# Symlink me to locale/*/Makefile
+# Symlink me to (or include me from) locale/*/Makefile
#### configuration
-BASE = ../../../common
+ASCIIDOC = asciidoc
+AWK = awk
-THIS_LOCALE = $(notdir $(shell pwd))
-THIS_LANG = $(firstword $(subst -, ,$(THIS_LOCALE)))
-ifneq ($(strip $(shell echo -n $(THIS_LANG) | wc -c)),2)
-THIS_LANG = en
-endif
+LOCALE = $(shell basename `pwd`)
+LANG = $(shell basename `pwd` | $(AWK) -F- '{ print ($$1 ~ /^[a-z][a-z]$$/) ? $$1 : "en" }')
ADC_SRC_FILES = $(wildcard *.txt)
ADC_FILES = $(ADC_SRC_FILES:%.txt=%.html)
-ADC_DEPS = $(wildcard asciidoc.conf lang-$(THIS_LANG).conf)
+ADC_DEPS = $(wildcard asciidoc.conf lang-$(LANG).conf)
-T2T_SRC_FILES = $(wildcard *.t2t)
-T2T_FILES = $(T2T_SRC_FILES:%.t2t=%.xhtml)
-T2T_DEPS = $(wildcard config.t2t)
-
-DOC_FILES = $(ADC_FILES) $(T2T_FILES)
-
-ASCIIDOC = asciidoc
-TXT2TAGS = txt2tags
-AWK = awk
+DOC_FILES = $(ADC_FILES) version.html
.SILENT:
@@ -31,49 +21,42 @@ AWK = awk
.PHONY: all help doc asciidoc check-asciidoc clean distclean
all: doc
-doc: asciidoc t2t
+doc: asciidoc
help:
- @echo "${NAME} ${VERSION} build"
+ @echo "$(NAME) $(VERSION) build"
@echo
@echo " make help - display this help"
@echo " make doc - build doc files"
- @echo " make asciidoc - build asciidoc'd files only"
- @echo " make t2t - build txt2tags'd files only"
@echo " make clean - clean up"
@echo " make distclean - clean up more"
clean:
- @echo "Cleanup..."
+ @echo "Cleanup of $(LOCALE) documentation..."
distclean: clean
- @echo "More cleanup..."
+ @echo "More cleanup of $(LOCALE) documentation..."
rm -f $(DOC_FILES)
#### Makes single-file makes easier to type
-%: %.html %.t2t %.xhtml %.t2t ;
-
%: %.html %.txt ;
-%: %.xhtml %.t2t ;
-
#### asciidoc
-asciidoc: check-asciidoc $(ADC_FILES)
+asciidoc: check-asciidoc $(DOC_FILES)
check-asciidoc:
@$(ASCIIDOC) --version | $(AWK) '{ exit $$2 !~ /^8\.2\./ }' || \
echo >&2 "Warning: asciidoc versions other than 8.2.x are unsupported"
$(ADC_FILES): %.html: %.txt $(BASE)/Makefile.doc $(ADC_DEPS)
- @echo "DOC locale/$(THIS_LOCALE)/$@"
- $(ASCIIDOC) --unsafe -a linkcss -a quirks! -a lang=$(THIS_LANG) -a doctitle="$(shell basename $@)" -o $@ $<
+ @echo "DOC locale/$(LOCALE)/$@"
+ $(ASCIIDOC) --unsafe -a linkcss -a quirks! -a lang=$(LANG) -a doctitle="$(shell basename $@)" -o $@ $<
-#### txt2tags
-
-t2t: $(T2T_FILES)
-
-$(T2T_FILES): %.xhtml: %.t2t $(BASE)/Makefile.doc $(T2T_DEPS)
- @echo "T2T locale/$(THIS_LOCALE)/$@"
- txt2tags --quiet $<
+version.html: ../../NEWS $(BASE)/Makefile.doc $(ADC_DEPS)
+ @echo "DOC locale/$(LOCALE)/$@"
+ # NOTE: asciidoc doesn't source the conf file implicitly when processing stdin
+ sed -e '1i\
+HEADER' -e '/^[0-9]/d' -e '/^ \+\* version /s/.*version \+\([0-9.]\+\).*/section:Version{nbsp}\1[version-\1]\
+/' ../../NEWS | ${ASCIIDOC} -f asciidoc.conf -a doctitle=version.html -o version.html -
diff --git a/common/content/buffer.js b/common/content/buffer.js
index 752709f4..3ede5053 100644
--- a/common/content/buffer.js
+++ b/common/content/buffer.js
@@ -867,9 +867,16 @@ function Buffer() //{{{
/**
* @property {string} The current top-level document's URL.
*/
- get URL()
+ get URL() window.content.location.href,
+
+ /**
+ * @property {string} The current top-level document's URL, sans any
+ * fragment identifier.
+ */
+ get URI()
{
- return window.content.document.location.href;
+ let loc = window.content.location;
+ return loc.href.substr(0, loc.href.length - loc.hash.length);
},
/**
@@ -1044,7 +1051,12 @@ function Buffer() //{{{
function followFrame(frame)
{
- function iter(elems) (e for ([i, e] in Iterator(elems)) if (e.rel.toLowerCase() == rel || e.rev.toLowerCase() == rel));
+ function iter(elems)
+ {
+ for (let i = 0; i < elems.length; i++)
+ if (elems[i].rel.toLowerCase() == rel || elems[i].rev.toLowerCase() == rel)
+ yield elems[i];
+ }
// s have higher priority than normal hrefs
let elems = frame.document.getElementsByTagName("link");
@@ -1065,16 +1077,10 @@ function Buffer() //{{{
let res = buffer.evaluateXPath(options["hinttags"], frame.document);
for (let [,regex] in Iterator(regexps))
{
- for (let i in util.range(res.snapshotLength, 0, true))
+ for (let i in util.range(res.snapshotLength, 0, -1))
{
let elem = res.snapshotItem(i);
- if (regex.test(elem.textContent))
- {
- buffer.followLink(elem, liberator.CURRENT_TAB);
- return true;
- }
- // images with alt text being href
- if (Array.some(elem.childNodes, function (child) regex.test(child.alt)))
+ if (regex.test(elem.textContent) || Array.some(elem.childNodes, function (child) regex.test(child.alt)))
{
buffer.followLink(elem, liberator.CURRENT_TAB);
return true;
@@ -1462,7 +1468,7 @@ function Buffer() //{{{
*/
viewSource: function (url, useExternalEditor)
{
- url = url || buffer.URL;
+ url = url || buffer.URI;
if (useExternalEditor)
editor.editFileExternally(url);
@@ -1625,7 +1631,7 @@ function Marks() //{{{
function (args)
{
let special = args.bang;
- let args = args.string;
+ args = args.string;
if (!special && !args)
{
diff --git a/common/content/commands.js b/common/content/commands.js
index 170568b1..d6417a23 100644
--- a/common/content/commands.js
+++ b/common/content/commands.js
@@ -573,7 +573,7 @@ function Commands() //{{{
count++; // to compensate the "=" character
}
- else if (!/\s/.test(sep)) // this isn't really an option as it has trailing characters, parse it as an argument
+ else if (!/\s/.test(sep) && sep != undefined) // this isn't really an option as it has trailing characters, parse it as an argument
{
invalid = true;
}
diff --git a/common/content/completion.js b/common/content/completion.js
index 4c0885d7..471eed19 100644
--- a/common/content/completion.js
+++ b/common/content/completion.js
@@ -220,6 +220,12 @@ function CompletionContext(editor, name, offset) //{{{
: item.item[key];
}
+CompletionContext.Sort = {
+ number: function (a, b) parseInt(b) - parseInt(a) || String.localeCompare(a, b),
+
+ unsorted: null
+};
+
CompletionContext.prototype = {
// Temporary
/**
@@ -554,10 +560,10 @@ CompletionContext.prototype = {
{
let self = this;
let items = this.items;
- let reverse = start > end;
+ let step = start > end ? -1 : 1;
start = Math.max(0, start || 0);
end = Math.min(items.length, end ? end : items.length);
- return util.map(util.range(start, end, reverse), function (i) items[i]);
+ return util.map(util.range(start, end, step), function (i) items[i]);
},
getRows: function getRows(start, end, doc)
@@ -565,10 +571,10 @@ CompletionContext.prototype = {
let self = this;
let items = this.items;
let cache = this.cache.rows;
- let reverse = start > end;
+ let step = start > end ? -1 : 1;
start = Math.max(0, start || 0);
end = Math.min(items.length, end != null ? end : items.length);
- for (let i in util.range(start, end, reverse))
+ for (let i in util.range(start, end, step))
yield [i, cache[i] = cache[i] || util.xmlToDom(self.createRow(items[i]), doc)];
},
@@ -720,22 +726,22 @@ function Completion() //{{{
this.completers = {};
+ // Some object members are only accessible as function calls
+ function getKey(obj, key)
+ {
+ try
+ {
+ return obj[key];
+ }
+ catch (e)
+ {
+ return undefined;
+ }
+ }
+
this.iter = function iter(obj)
{
- let iterator = (function objIter()
- {
- for (let k in obj)
- {
- // Some object members are only accessible as function calls
- try
- {
- yield [k, obj[k]];
- continue;
- }
- catch (e) {}
- yield [k, <>inaccessable>]
- }
- })();
+ let iterator = ([k, getKey(obj, k)] for (k in obj));
try
{
// The point of 'for k in obj' is to get keys
@@ -775,21 +781,21 @@ function Completion() //{{{
// available in the object itself.
let orig = obj;
- // v[0] in orig and orig[v[0]] catch different cases. XPCOM
- // objects are problematic, to say the least.
if (modules.isPrototypeOf(obj))
compl = [v for (v in Iterator(obj))];
else
{
- if (obj.wrappedJSObject)
+ if (getKey(obj, 'wrappedJSObject'))
obj = obj.wrappedJSObject;
+ // v[0] in orig and orig[v[0]] catch different cases. XPCOM
+ // objects are problematic, to say the least.
compl = [v for (v in this.iter(obj))
- if ((typeof orig == "object" && v[0] in orig) || orig[v[0]] !== undefined)];
+ if ((typeof orig == "object" && v[0] in orig) || getKey(orig, v[0]) !== undefined)];
}
// And if wrappedJSObject happens to be available,
// return that, too.
- if (orig.wrappedJSObject)
+ if (getKey(orig, 'wrappedJSObject'))
compl.push(["wrappedJSObject", obj]);
// Add keys for sorting later.
@@ -1381,6 +1387,7 @@ function Completion() //{{{
context.anchored = false;
context.title = ["Buffer", "URL"];
context.keys = { text: "text", description: "url", icon: "icon" };
+ context.compare = CompletionContext.Sort.number;
let process = context.process[0];
context.process = [function (item, text)
<>
@@ -1560,7 +1567,7 @@ function Completion() //{{{
{
context.format = history.format;
context.title = ["History"]
- context.compare = null;
+ context.compare = CompletionContext.Sort.unsorted;
//context.background = true;
if (context.maxItems == null)
context.maxItems = 100;
@@ -1584,7 +1591,7 @@ function Completion() //{{{
context.hasItems = context.completions.length > 0; // XXX
context.filterFunc = null;
context.cancel = function () services.get("autoCompleteSearch").stopSearch();
- context.compare = null;
+ context.compare = CompletionContext.Sort.unsorted;
let timer = new Timer(50, 100, function (result) {
context.incomplete = result.searchResult >= result.RESULT_NOMATCH_ONGOING;
context.completions = [
@@ -1655,7 +1662,8 @@ function Completion() //{{{
completer = function () [["true", ""], ["false", ""]];
break;
case "stringlist":
- len = newValues.pop().length;
+ let target = newValues.pop();
+ len = target ? target.length : 0;
break;
case "charlist":
len = 0;
@@ -1716,7 +1724,7 @@ function Completion() //{{{
context.format = history.format;
context.title = [keyword + " Quick Search"];
// context.background = true;
- context.compare = null;
+ context.compare = CompletionContext.Sort.unsorted;
context.generate = function () {
let [begin, end] = item.url.split("%s");
@@ -1751,7 +1759,7 @@ function Completion() //{{{
let ctxt = context.fork(name, 0);
ctxt.title = [engine.description + " Suggestions"];
- ctxt.compare = null;
+ ctxt.compare = CompletionContext.Sort.unsorted;
ctxt.incomplete = true;
bookmarks.getSuggestions(name, ctxt.filter, function (compl) {
ctxt.incomplete = false;
diff --git a/common/content/editor.js b/common/content/editor.js
index 8e0c603e..b62aad98 100644
--- a/common/content/editor.js
+++ b/common/content/editor.js
@@ -204,7 +204,7 @@ function Editor() //{{{
function (args)
{
let matches = args.string.match(RegExp("^\\s*($|" + abbrevmatch + ")(?:\\s*$|\\s+(.*))"));
- if (! matches)
+ if (!matches)
{
liberator.echoerr("E474: Invalid argument");
return false;
@@ -607,8 +607,12 @@ function Editor() //{{{
unselectText: function ()
{
let elem = window.document.commandDispatcher.focusedElement;
- if (elem && elem.selectionEnd)
- elem.selectionEnd = elem.selectionStart;
+ // A error occurs if the element has been removed when "elem.selectionStart" is executed.
+ try {
+ if (elem && elem.selectionEnd)
+ elem.selectionEnd = elem.selectionStart;
+ }
+ catch (e) {}
},
selectedText: function ()
diff --git a/common/content/events.js b/common/content/events.js
index d50c76c5..3c9db52a 100644
--- a/common/content/events.js
+++ b/common/content/events.js
@@ -932,6 +932,8 @@ function Events() //{{{
{
if (!ctrl && !alt && !shift && !meta)
return false; // an invalid key like
+ else if (shift)
+ keyname = keyname.toUpperCase();
charCode = keyname.charCodeAt(0);
}
else if (keyname.toLowerCase() == "space")
@@ -1033,6 +1035,37 @@ function Events() //{{{
}
}
}
+ // [Ctrl-Bug] special handling of mysterious , , , , bugs (OS/X)
+ // (i.e., cntrl codes 27--31)
+ // ---
+ // For more information, see:
+ // [*] Vimp FAQ: http://vimperator.org/trac/wiki/Vimperator/FAQ#WhydoesntC-workforEscMacOSX
+ // [*] Referenced mailing list msg: http://www.mozdev.org/pipermail/vimperator/2008-May/001548.html
+ // [*] Mozilla bug 416227: event.charCode in keypress handler has unexpected values on Mac for Ctrl with chars in "[ ] _ \"
+ // https://bugzilla.mozilla.org/show_bug.cgi?query_format=specific&order=relevance+desc&bug_status=__open__&id=416227
+ // [*] Mozilla bug 432951: Ctrl+'foo' doesn't seem same charCode as Meta+'foo' on Cocoa
+ // https://bugzilla.mozilla.org/show_bug.cgi?query_format=specific&order=relevance+desc&bug_status=__open__&id=432951
+ // ---
+ //
+ // The following fixes are only activated if liberator.has("MacUnix").
+ // Technically, they prevent mappings from (and
+ // if your fancy keyboard permits such things>), but
+ // these mappings are probably pathological (
+ // certainly is on Windows), and so it is probably
+ // harmless to remove the has("MacUnix") if desired.
+ //
+ else if (liberator.has("MacUnix") && event.ctrlKey && event.charCode >= 27 && event.charCode <= 31)
+ {
+ if (event.charCode == 27) // [Ctrl-Bug 1/5] the bug
+ {
+ key = "Esc";
+ modifier = modifier.replace("C-", "");
+ }
+ else // [Ctrl-Bug 2,3,4,5/5] the , , , bugs
+ {
+ key = String.fromCharCode(event.charCode + 64);
+ }
+ }
// special handling of the Space key
else if (event.charCode == 32)
{
@@ -1089,7 +1122,7 @@ function Events() //{{{
waitForPageLoad: function ()
{
- liberator.dump("start waiting in loaded state: " + buffer.loaded);
+ //liberator.dump("start waiting in loaded state: " + buffer.loaded);
liberator.threadYield(true); // clear queue
if (buffer.loaded == 1)
@@ -1102,8 +1135,8 @@ function Events() //{{{
while (now = Date.now(), now < end)
{
liberator.threadYield();
- if ((now - start) % 1000 < 10)
- liberator.dump("waited: " + (now - start) + " ms");
+ //if ((now - start) % 1000 < 10)
+ // liberator.dump("waited: " + (now - start) + " ms");
if (!events.feedingKeys)
return false;
@@ -1122,7 +1155,7 @@ function Events() //{{{
let ret = (buffer.loaded == 1);
if (!ret)
liberator.echoerr("Page did not load completely in " + maxWaitTime + " seconds. Macro stopped.");
- liberator.dump("done waiting: " + ret);
+ //liberator.dump("done waiting: " + ret);
// sometimes the input widget had focus when replaying a macro
// maybe this call should be moved somewhere else?
@@ -1186,7 +1219,7 @@ function Events() //{{{
{
if (config.isComposeWindow)
{
- liberator.dump("Compose editor got focus");
+ //liberator.dump("Compose editor got focus");
modes.set(modes.INSERT, modes.TEXTAREA);
}
else if (liberator.mode != modes.MESSAGE)
diff --git a/common/content/hints.js b/common/content/hints.js
index b68f821c..cf877078 100644
--- a/common/content/hints.js
+++ b/common/content/hints.js
@@ -399,87 +399,51 @@ function Hints() //{{{
let wordSplitRegex = RegExp(options["wordseparators"]);
// What the **** does this do? --Kris
+ //
+ // This function matches hintStrings like 'hekho' to links like 'Hey Kris, how are you?' -> [HE]y [K]ris [HO]w are you --Daniel
function charsAtBeginningOfWords(chars, words, allowWordOverleaping)
{
- let charIdx = 0;
- let numMatchedWords = 0;
- for (let [,word] in Iterator(words))
+ function charMatches(charIdx, chars, wordIdx, words, inWordIdx, allowWordOverleaping)
{
- if (word.length == 0)
- continue;
-
- let wcIdx = 0;
- // Check if the current word matches same characters as the previous word.
- // Each already matched word has matched at least one character.
- if (charIdx > numMatchedWords)
+ let matches = (chars[charIdx] == words[wordIdx][inWordIdx]);
+ if ((matches == false && allowWordOverleaping) || words[wordIdx].length == 0)
{
- let matchingStarted = false;
- for (let i in util.range(numMatchedWords, charIdx))
- {
- if (chars[i] == word[wcIdx])
- {
- matchingStarted = true;
- wcIdx++;
- }
- else if (matchingStarted)
- {
- wcIdx = 0;
- break;
- }
- }
+ let nextWordIdx = wordIdx + 1;
+ if (nextWordIdx == words.length)
+ return false;
+
+ return charMatches(charIdx, chars, nextWordIdx, words, 0, allowWordOverleaping);
}
- // the current word matches same characters as the previous word
- let prevCharIdx;
- if (wcIdx > 0)
+ if (matches)
{
- prevCharIdx = charIdx;
- // now check if it matches additional characters
- for (; wcIdx < word.length && charIdx < chars.length; wcIdx++, charIdx++)
- {
- if (word[wcIdx] != chars[charIdx])
- break;
- }
+ let nextCharIdx = charIdx + 1;
+ if (nextCharIdx == chars.length)
+ return true;
- // the word doesn't match additional characters, now check if the
- // already matched characters are equal to the next characters for matching,
- // if yes, then consume them
- if (prevCharIdx == charIdx)
- {
- for (let i = 0; i < wcIdx && charIdx < chars.length; i++, charIdx++)
- {
- if (word[i] != chars[charIdx])
- break;
- }
- }
+ let nextWordIdx = wordIdx + 1;
+ let beyondLastWord = (nextWordIdx == words.length);
+ let charMatched = false;
+ if (beyondLastWord == false)
+ charMatched = charMatches(nextCharIdx, chars, nextWordIdx, words, 0, allowWordOverleaping)
- numMatchedWords++;
- }
- // the current word doesn't match same characters as the previous word, just
- // try to match the next characters
- else
- {
- prevCharIdx = charIdx;
- for (let i = 0; i < word.length && charIdx < chars.length; i++, charIdx++)
- {
- if (word[i] != chars[charIdx])
- break;
- }
+ if (charMatched)
+ return true;
- if (prevCharIdx == charIdx)
+ if (charMatched == false || beyondLastWord == true)
{
- if (!allowWordOverleaping)
+ let nextInWordIdx = inWordIdx + 1;
+ if (nextInWordIdx == words[wordIdx].length)
return false;
+
+ return charMatches(nextCharIdx, chars, wordIdx, words, nextInWordIdx, allowWordOverleaping);
}
- else
- numMatchedWords++;
}
- if (charIdx == chars.length)
- return true;
+ return false;
}
- return (charIdx == chars.length);
+ return charMatches(0, chars, 0, words, 0, allowWordOverleaping);
}
function stringsAtBeginningOfWords(strings, words, allowWordOverleaping)
@@ -510,8 +474,6 @@ function Hints() //{{{
return function (linkText)
{
- liberator.dump(hintStrings);
-
if (hintStrings.length == 1 && hintStrings[0].length == 0)
return true;
@@ -613,7 +575,7 @@ function Hints() //{{{
function (count)
{
extendedhintCount = count;
- commandline.input(";", function (arg) { setTimeout(function () hints.show(arg), 0); },
+ commandline.input(";", null,
{
promptHighlight: "Normal",
completer: function (context)
@@ -621,7 +583,8 @@ function Hints() //{{{
context.compare = function () 0;
context.completions = [[k, v.prompt] for ([k, v] in Iterator(hintModes))];
},
- onChange: function () { modes.pop() }
+ onChange: function () { modes.pop() },
+ onCancel: function (arg) { arg && setTimeout(function () hints.show(arg), 0); },
});
}, { flags: Mappings.flags.COUNT });
diff --git a/common/content/liberator.js b/common/content/liberator.js
index c89b9a5d..37958ef6 100644
--- a/common/content/liberator.js
+++ b/common/content/liberator.js
@@ -121,7 +121,7 @@ const liberator = (function () //{{{
let class = dir.map(function (dir) "html|html > xul|scrollbar[orient=" + dir + "]");
if (class.length)
- styles.addSheet(true, "scrollbar", "*", class.join(", ") + " { visibility: collapse !important; }");
+ styles.addSheet(true, "scrollbar", "*", class.join(", ") + " { visibility: collapse !important; }", true);
else
styles.removeSheet(true, "scrollbar");
options.safeSetPref("layout.scrollbar.side", opts.indexOf("l") >= 0 ? 3 : 2);
@@ -264,7 +264,7 @@ const liberator = (function () //{{{
for (let [,dialog] in Iterator(dialogs))
{
- if (arg == dialog[0])
+ if (util.compareIgnoreCase(arg, dialog[0]) == 0)
{
dialog[2]();
return;
@@ -281,7 +281,11 @@ const liberator = (function () //{{{
{
argCount: "1",
bang: true,
- completer: function (context, args) completion.dialog(context)
+ completer: function (context)
+ {
+ context.ignoreCase = true;
+ return completion.dialog(context);
+ }
});
commands.add(["em[enu]"],
@@ -601,7 +605,7 @@ const liberator = (function () //{{{
forceNewTab: false,
- // ###VERSION### and ###DATE### are replaced by the Makefile
+ // these VERSION and DATE tokens are replaced by the Makefile
version: "###VERSION### (created: ###DATE###)",
// NOTE: services.get("profile").selectedProfile.name is not rightness.
@@ -842,7 +846,7 @@ const liberator = (function () //{{{
// Number
else if (matches = string.match(/^(\d+)$/))
{
- return parseInt(match[1], 10);
+ return parseInt(matches[1], 10);
}
let reference = this.variableReference(string);
@@ -1422,7 +1426,6 @@ window.liberator = liberator;
// FIXME: Ugly, etc.
window.addEventListener("liberatorHelpLink", function (event) {
let elem = event.target;
- liberator.dump(String(elem));
if (/^(option|mapping|command)$/.test(elem.className))
var tag = elem.textContent.replace(/\s.*/, "");
if (elem.className == "command")
diff --git a/common/content/options.js b/common/content/options.js
index 54b3bb8d..1442ce23 100644
--- a/common/content/options.js
+++ b/common/content/options.js
@@ -80,7 +80,7 @@ Option.prototype = {
parseValues: function (value)
{
if (this.type == "stringlist")
- return value.split(",");
+ return (value === "") ? [] : value.split(",");
if (this.type == "charlist")
return Array.slice(value);
return value;
@@ -203,9 +203,9 @@ Option.prototype = {
break;
case "number":
- let value = parseInt(values); // deduce radix
+ let value = Number(values); // deduce radix
- if (isNaN(value))
+ if (isNaN(value) || value != parseInt(value))
return "E521: Number required";
switch (operator)
@@ -335,7 +335,11 @@ function Options() //{{{
{
case "string":
if (type == Ci.nsIPrefBranch.PREF_INVALID || type == Ci.nsIPrefBranch.PREF_STRING)
- services.get("pref").setCharPref(name, value);
+ {
+ let supportString = Cc["@mozilla.org/supports-string;1"].createInstance(Ci.nsISupportsString);
+ supportString.data = value;
+ services.get("pref").setComplexValue(name, Ci.nsISupportsString, supportString);
+ }
else if (type == Ci.nsIPrefBranch.PREF_INT)
liberator.echoerr("E521: Number required after =: " + name + "=" + value);
else
diff --git a/common/content/style.js b/common/content/style.js
index 50a38f5c..d994dbd6 100644
--- a/common/content/style.js
+++ b/common/content/style.js
@@ -182,7 +182,7 @@ function Highlights(name, store, serial)
{
css = style.selector + " { " + css + " }";
- let error = styles.addSheet(true, style.selector, style.filter, css);
+ let error = styles.addSheet(true, style.selector, style.filter, css, true);
if (error)
return error;
}
@@ -235,6 +235,7 @@ function Highlights(name, store, serial)
this.set(class);
}
};
+ this.reload();
}
/**
@@ -257,7 +258,7 @@ function Styles(name, store, serial)
const namespace = '@namespace html "' + XHTML + '";\n' +
'@namespace xul "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";\n' +
'@namespace liberator "' + NS.uri + '";\n';
- const Sheet = new Struct("name", "sites", "css", "ref");
+ const Sheet = new Struct("name", "sites", "css", "ref", "agent");
let cssUri = function (css) "chrome-data:text/css," + window.encodeURI(css);
@@ -285,7 +286,7 @@ function Styles(name, store, serial)
* "*" is matched as a prefix.
* @param {string} css The CSS to be applied.
*/
- this.addSheet = function (system, name, filter, css)
+ this.addSheet = function (system, name, filter, css, agent)
{
let sheets = system ? systemSheets : userSheets;
let names = system ? systemNames : userNames;
@@ -294,7 +295,7 @@ function Styles(name, store, serial)
let sheet = sheets.filter(function (s) s.sites.join(",") == filter && s.css == css)[0];
if (!sheet)
- sheet = new Sheet(name, filter.split(",").filter(util.identity), css, null);
+ sheet = new Sheet(name, filter.split(",").filter(util.identity), css, null, agent);
if (sheet.ref == null) // Not registered yet
{
@@ -302,7 +303,8 @@ function Styles(name, store, serial)
try
{
this.registerSheet(cssUri(wrapCSS(sheet)));
- this.registerAgentSheet(cssUri(wrapCSS(sheet)))
+ if (sheet.agent)
+ this.registerAgentSheet(cssUri(wrapCSS(sheet)))
}
catch (e)
{
@@ -410,7 +412,7 @@ function Styles(name, store, serial)
{
let sites = sheet.sites.filter(function (f) f != filter);
if (sites.length)
- this.addSheet(system, name, sites.join(","), css);
+ this.addSheet(system, name, sites.join(","), css, sheet.agent);
}
}
return matches.length;
@@ -514,8 +516,11 @@ const styles = storage.newObject("styles", Styles, false);
*/
const highlight = storage.newObject("highlight", Highlights, false);
-highlight.CSS = Highlights.prototype.CSS;
-highlight.reload();
+if (highlight.CSS != Highlights.prototype.CSS)
+{
+ highlight.CSS = Highlights.prototype.CSS;
+ highlight.reload();
+}
liberator.triggerObserver("load_styles", "styles");
liberator.triggerObserver("load_highlight", "highlight");
diff --git a/common/content/template.js b/common/content/template.js
index 981f72f8..b4f14bfd 100644
--- a/common/content/template.js
+++ b/common/content/template.js
@@ -133,9 +133,9 @@ const template = {
highlight: function highlight(arg, processStrings, clip)
{
// some objects like window.JSON or getBrowsers()._browsers need the try/catch
- let str = clip ? util.clip(String(arg), clip) : String(arg);
try
{
+ let str = clip ? util.clip(String(arg), clip) : String(arg);
switch (arg == null ? "undefined" : typeof arg)
{
case "number":
diff --git a/common/content/ui.js b/common/content/ui.js
index eb1d003e..efdfeddb 100644
--- a/common/content/ui.js
+++ b/common/content/ui.js
@@ -529,7 +529,7 @@ function CommandLine() //{{{
autocompleteTimer.tell(false);
});
- liberator.registerCallback("cancel", modes.PROMPT, closePrompt);
+ liberator.registerCallback("cancel", modes.PROMPT, cancelPrompt);
liberator.registerCallback("submit", modes.PROMPT, closePrompt);
liberator.registerCallback("change", modes.PROMPT, function (str) {
if (input.complete)
@@ -542,6 +542,14 @@ function CommandLine() //{{{
context.fork("input", 0, commandline, input.complete);
});
+ function cancelPrompt(value)
+ {
+ let callback = input.cancel;
+ input = {};
+ if (callback)
+ callback.call(commandline, value != null ? value : commandline.command);
+ }
+
function closePrompt(value)
{
let callback = input.submit;
@@ -1008,10 +1016,9 @@ function CommandLine() //{{{
set silent(val)
{
silent = val;
- if (silent)
- storage.styles.addSheet(true, "silent-mode", "chrome://*", "#liberator-commandline > * { opacity: 0 }");
- else
- storage.styles.removeSheet(true, "silent-mode");
+ Array.forEach(document.getElementById("liberator-commandline").childNodes, function (node) {
+ node.style.opacity = silent ? "0" : "";
+ });
},
runSilently: function (fn, self)
@@ -1214,6 +1221,7 @@ function CommandLine() //{{{
submit: callback,
change: extra.onChange,
complete: extra.completer,
+ cancel: extra.onCancel,
};
modes.push(modes.COMMAND_LINE, modes.PROMPT);
@@ -1285,7 +1293,8 @@ function CommandLine() //{{{
}
else if (event.type == "input")
{
- //this.resetCompletions(); -> already handled by "keypress" below (hopefully), so don't do it twice
+ //liberator.dump("input: " + command);
+ this.resetCompletions();
liberator.triggerCallback("change", currentExtendedMode, command);
}
else if (event.type == "keypress")
@@ -1333,7 +1342,7 @@ function CommandLine() //{{{
else if (key == "")
{
// reset the tab completion
- this.resetCompletions();
+ //this.resetCompletions();
// and blur the command line if there is no text left
if (command.length == 0)
@@ -1344,7 +1353,7 @@ function CommandLine() //{{{
}
else // any other key
{
- this.resetCompletions();
+ //this.resetCompletions();
}
return true; // allow this event to be handled by Firefox
}
@@ -1769,7 +1778,7 @@ function ItemList(id) //{{{
, divNodes);
doc.body.replaceChild(div, doc.body.firstChild);
- div.scrollIntoView(true);
+ //div.scrollIntoView(true);
items.contextList.forEach(function init_eachContext(context) {
delete context.cache.nodes;
@@ -1952,7 +1961,7 @@ function ItemList(id) //{{{
if (index >= 0)
{
getCompletion(index).setAttribute("selected", "true");
- getCompletion(index).scrollIntoView(false);
+ //getCompletion(index).scrollIntoView(false);
}
//if (index == 0)
diff --git a/common/content/util.js b/common/content/util.js
index 95a73230..5409d0c9 100644
--- a/common/content/util.js
+++ b/common/content/util.js
@@ -519,25 +519,28 @@ const util = { //{{{
},
/**
- * A generator that returns the values between start and end.
- * If reverse is true then the values are returned in reverse order.
+ * A generator that returns the values between start and end,
+ * in step increments.
*
* @param {number} start The interval's start value.
* @param {number} end The interval's end value.
- * @param {boolean} reverse Reverse the order in which the values are produced.
+ * @param {boolean} step The value to step the range by. May be
+ * negative. @default 1
* @returns {Iterator(Object)}
*/
- range: function range(start, end, reverse)
+ range: function range(start, end, step)
{
- if (!reverse)
+ if (!step)
+ step = 1;
+ if (step > 0)
{
- while (start < end)
- yield start++;
+ for (; start < end; start += step)
+ yield start;
}
else
{
while (start > end)
- yield --start;
+ yield start += step;
}
},
@@ -669,6 +672,13 @@ const util = { //{{{
xmlToDom: function xmlToDom(node, doc, nodes)
{
XML.prettyPrinting = false;
+ if (node.length() != 1)
+ {
+ let domnode = doc.createDocumentFragment();
+ for each (let child in node)
+ domnode.appendChild(arguments.callee(child, doc, nodes));
+ return domnode;
+ }
switch (node.nodeKind())
{
case "text":
diff --git a/muttator/content/config.js b/muttator/content/config.js
index 259d019d..6b1979bb 100644
--- a/muttator/content/config.js
+++ b/muttator/content/config.js
@@ -103,7 +103,8 @@ const config = { //{{{
],
// they are sorted by relevance, not alphabetically
- helpFiles: ["intro.html"],/* "tutorial.html", "starting.html",
+ helpFiles: ["intro.html", "version.html"],
+ /* "tutorial.html", "starting.html",
"browsing.html", "buffer.html", "pattern.html", "options.html",
"tabs.html", "hints.html", "map.html", "eval.html", "marks.html",
"repeat.html", "autocommands.html", "print.html", "developer.html",
diff --git a/muttator/content/mail.js b/muttator/content/mail.js
index 61242230..1e523167 100644
--- a/muttator/content/mail.js
+++ b/muttator/content/mail.js
@@ -995,12 +995,13 @@ function Mail() //{{{
// TODO: find out why, and solve the problem
try
{
- var msgs = folder.getMessages(msgWindow);
+ var msgs = folder.messages;
}
catch (e)
{
- liberator.dump("ERROR: " + folder.prettyName + " failed to getMessages\n");
- continue;
+ var msgs = folder.getMessages(msgWindow); // for older thunderbirds
+ liberator.dump("WARNING: " + folder.prettyName + " failed to getMessages, trying old API");
+ //continue;
}
while (msgs.hasMoreElements())
diff --git a/muttator/contrib/vim/Makefile b/muttator/contrib/vim/Makefile
new file mode 100644
index 00000000..b1156448
--- /dev/null
+++ b/muttator/contrib/vim/Makefile
@@ -0,0 +1,9 @@
+VIMBALL = muttator.vba
+
+vimball: mkvimball.txt syntax/muttator.vim ftdetect/muttator.vim
+ -echo '%MkVimball! ${VIMBALL} .' | vim -u NORC -N -e -s mkvimball.txt
+
+all: vimball
+
+clean:
+ rm -f ${VIMBALL}
diff --git a/muttator/contrib/vim/ftdetect/muttator.vim b/muttator/contrib/vim/ftdetect/muttator.vim
new file mode 100644
index 00000000..391e6b6a
--- /dev/null
+++ b/muttator/contrib/vim/ftdetect/muttator.vim
@@ -0,0 +1,2 @@
+" TODO: what's the Muttator filename extension?
+au BufNewFile,BufRead *muttatorrc*,*.muttator set filetype=muttator
diff --git a/muttator/contrib/vim/mkvimball.txt b/muttator/contrib/vim/mkvimball.txt
new file mode 100644
index 00000000..484bb52f
--- /dev/null
+++ b/muttator/contrib/vim/mkvimball.txt
@@ -0,0 +1,2 @@
+syntax/muttator.vim
+ftdetect/muttator.vim
diff --git a/muttator/contrib/vim/syntax/muttator.vim b/muttator/contrib/vim/syntax/muttator.vim
new file mode 100644
index 00000000..296fbd34
--- /dev/null
+++ b/muttator/contrib/vim/syntax/muttator.vim
@@ -0,0 +1,100 @@
+" Vim syntax file
+" Language: Muttator configuration file
+" Maintainer: Doug Kearns
+" Last Change: 2009 Feb 19
+
+if exists("b:current_syntax")
+ finish
+endif
+
+let s:cpo_save = &cpo
+set cpo&vim
+
+syn include @javascriptTop syntax/javascript.vim
+unlet b:current_syntax
+
+syn include @cssTop syntax/css.vim
+unlet b:current_syntax
+
+syn match muttatorCommandStart "\%(^\s*:\=\)\@<=" nextgroup=muttatorCommand,muttatorAutoCmd
+
+syn keyword muttatorCommand ab[breviate] ab[clear] addo[ns] addr[essbook] bN[ext] bd[elete] beep bf[irst] bl[ast] bn[ext]
+ \ bp[revious] br[ewind] bun[load] bw[ipeout] ca[bbrev] cabc[lear] cd chd[ir] cm[ap] cmapc[lear] cno[remap] colo[rscheme]
+ \ com[mand] comc[lear] con[tact] contacts copy[to] cu[nmap] cuna[bbrev] delc[ommand] delm[arks] delmac[ros] dels[tyle]
+ \ dia[log] do[autocmd] doautoa[ll] ec[ho] echoe[rr] echom[sg] em[enu] empty[trash] exe[cute] exu[sage] fini[sh] get[messages]
+ \ go[to] h[elp] ha[rdcopy] hi[ghlight] ia[bbrev] iabc[lear] im[ap] imapc[lear] ino[remap] iu[nmap] iuna[bbrev] javas[cript] js
+ \ let loadplugins lpl m[ail] ma[rk] macros map mapc[lear] marks mes[sages] mkm[uttatorrc] mm[ap] mmapc[lear] mu[nmap]
+ \ mno[remap] move[to] no[remap] norm[al] optionu[sage] pa[geinfo] pagest[yle] pc[lose] pl[ay] pref[erences] prefs pw[d] q[uit]
+ \ re[load] res[tart] run runt[ime] sav[eas] scrip[tnames] se[t] setg[lobal] setl[ocal] so[urce] st[op] sty[le] tN[ext] t[open]
+ \ tab tabN[ext] tabc[lose] tabfir[st] tabl[ast] tabn[ext] tabp[revious] tabr[ewind] time tn[ext] tp[revious] una[bbreviate]
+ \ unl[et] unm[ap] ve[rsion] vie[wsource] viu[sage] w[rite] zo[om]
+ \ contained
+
+syn match muttatorCommand "!" contained
+
+syn keyword muttatorAutoCmd au[tocmd] contained nextgroup=muttatorAutoEventList skipwhite
+
+syn keyword muttatorAutoEvent BookmarkAdd DOMLoad LocationChange PageLoadPre PageLoad ShellCmdPost muttatorEnter
+ \ muttatorLeavePre muttatorLeave
+ \ contained
+
+syn match muttatorAutoEventList "\(\a\+,\)*\a\+" contained contains=muttatorAutoEvent
+
+syn region muttatorSet matchgroup=muttatorCommand start="\%(^\s*:\=\)\@<=\<\%(setl\%[ocal]\|setg\%[lobal]\|set\=\)\=\>"
+ \ end="$" keepend oneline contains=muttatorOption,muttatorString
+
+syn keyword muttatorOption archivefolder cdpath cd complete cpt editor eventignore ei extendedhinttags eht followhints fh
+ \ guioptions go helpfile hf hintmatching hm hinttags ht hinttimeout hto history hi laststatus ls layout messages msgs
+ \ nextpattern pageinfo pa previouspattern runtimepath rtp scroll scr shell sh shellcmdflag shcf showstatuslinks ssli
+ \ showtabline stal suggestengines urlseparator verbose vbs wildcase wic wildignore wig wildmode wim wildoptions wop
+ \ wordseparators wsp
+ \ contained nextgroup=muttatorSetMod
+
+" toggle options
+syn match muttatorOption "\<\%(no\|inv\)\=\%(autoexternal\|errorbells\|eb\|exrc\|ex\|focuscontent\|fc\|fullscreen\|fs\)\>!\="
+ \ contained nextgroup=muttatorSetMod
+syn match muttatorOption "\<\%(no\|inv\)\=\%(insertmode\|im\|loadplugins\|lpl\|more\|showmode\|smd\|visualbell\|vb\)\>!\="
+ \ contained nextgroup=muttatorSetMod
+syn match muttatorOption "\<\%(no\|inv\)\=\%(usermode\|um\)\>!\="
+ \ contained nextgroup=muttatorSetMod
+
+syn match muttatorSetMod "\%(\<[a-z_]\+\)\@<=&" contained
+
+syn region muttatorJavaScript start="\%(^\s*\%(javascript\|js\)\s\+\)\@<=" end="$" contains=@javascriptTop keepend oneline
+syn region muttatorJavaScript matchgroup=muttatorJavascriptDelimiter
+ \ start="\%(^\s*\%(javascript\|js\)\s\+\)\@<=<<\s*\z(\h\w*\)"hs=s+2 end="^\z1$" contains=@javascriptTop fold
+
+let s:cssRegionStart = '\%(^\s*sty\%[le]!\=\s\+\%(-\%(n\|name\)\%(\s\+\|=\)\S\+\s\+\)\=[^-]\S\+\s\+\)\@<='
+execute 'syn region muttatorCss start="' . s:cssRegionStart . '" end="$" contains=@cssTop keepend oneline'
+execute 'syn region muttatorCss matchgroup=muttatorCssDelimiter'
+ \ 'start="' . s:cssRegionStart . '<<\s*\z(\h\w*\)"hs=s+2 end="^\z1$" contains=@cssTop fold'
+
+syn match muttatorNotation "<[0-9A-Za-z-]\+>"
+
+syn match muttatorComment +".*$+ contains=muttatorTodo,@Spell
+syn keyword muttatorTodo FIXME NOTE TODO XXX contained
+
+syn region muttatorString start="\z(["']\)" end="\z1" skip="\\\\\|\\\z1" oneline
+
+syn match muttatorLineComment +^\s*".*$+ contains=muttatorTodo,@Spell
+
+" NOTE: match vim.vim highlighting group names
+hi def link muttatorAutoCmd muttatorCommand
+hi def link muttatorAutoEvent Type
+hi def link muttatorCommand Statement
+hi def link muttatorComment Comment
+hi def link muttatorJavascriptDelimiter Delimiter
+hi def link muttatorCssDelimiter Delimiter
+hi def link muttatorNotation Special
+hi def link muttatorLineComment Comment
+hi def link muttatorOption PreProc
+hi def link muttatorSetMod muttatorOption
+hi def link muttatorString String
+hi def link muttatorTodo Todo
+
+let b:current_syntax = "muttator"
+
+let &cpo = s:cpo_save
+unlet s:cpo_save
+
+" vim: tw=130 et ts=4 sw=4:
diff --git a/muttator/install.rdf b/muttator/install.rdf
index e02650d2..3785bda0 100644
--- a/muttator/install.rdf
+++ b/muttator/install.rdf
@@ -1,28 +1,28 @@
-
-
-
-
-
- muttator@mozdev.org
- Muttator
- ###VERSION###
- Make Thunderbird behave like Vim
- Martin Stubenschrott
- http://vimperator.org/
- chrome://muttator/skin/icon.png
-
-
- content/muttator/
-
-
-
-
-
- {3550f703-e582-4d05-9a08-453d09bdfdc6}
- 3.0a1pre
- 3.0b2pre
-
-
-
-
-
+
+
+
+
+
+ muttator@mozdev.org
+ Muttator
+ ###VERSION###
+ Make Thunderbird behave like Vim
+ Martin Stubenschrott
+ http://vimperator.org/
+ chrome://muttator/skin/icon.png
+
+
+ content/muttator/
+
+
+
+
+
+ {3550f703-e582-4d05-9a08-453d09bdfdc6}
+ 3.0b2pre
+ 3.0b2
+
+
+
+
+
diff --git a/muttator/locale/en-US/Makefile b/muttator/locale/en-US/Makefile
deleted file mode 120000
index 85510a12..00000000
--- a/muttator/locale/en-US/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../../../common/Makefile.doc
\ No newline at end of file
diff --git a/muttator/locale/en-US/Makefile b/muttator/locale/en-US/Makefile
new file mode 100644
index 00000000..627ca99b
--- /dev/null
+++ b/muttator/locale/en-US/Makefile
@@ -0,0 +1,2 @@
+BASE = ../../../common
+include $(BASE)/Makefile.doc
diff --git a/vimperator/AUTHORS b/vimperator/AUTHORS
index 8d89467e..8d939af8 100644
--- a/vimperator/AUTHORS
+++ b/vimperator/AUTHORS
@@ -7,6 +7,10 @@ Developers:
* Tim Hammerquist (penryu@gmail.com)
* Konstantin Stepanov (milezv@yandex.ru)
* Kris Maglione
+ * Ted Pavlic
+ * anekos
+ * teramako
+ * janus_wel
Inactive/former developers:
* Viktor Kojouharov (Виктор Кожухаров)
@@ -33,3 +37,4 @@ Patches (in no special order):
* Raimon Grau Cuscó (document relationship navigation - ]], [[)
* Ryan Zheng (ctrl-x/a support)
* Dan Boger (:set online support)
+ * Štěpán Němec (help copy-editing and favicon support)
diff --git a/vimperator/Donors b/vimperator/Donors
index ec93f6f7..638ede86 100644
--- a/vimperator/Donors
+++ b/vimperator/Donors
@@ -1,7 +1,16 @@
-Contiuous donations:
+Continuous donations:
* Daniel Bainton (web hosting)
2009:
+* Convolution
+* Brian Hall
+* Daniel Hahler
+* Per-Henrik Persson
+* David C Foor
+* Oliver Schaefer
+* Paul Moss
+* Yongji Zhang
+* Brian Peiris
* Peleg Michaeli ("Every hand revealed" from my amazon.de wishlist)
* InspireFocus
* Michael Fremont
diff --git a/vimperator/Makefile b/vimperator/Makefile
index fac3417f..639ea591 100644
--- a/vimperator/Makefile
+++ b/vimperator/Makefile
@@ -1,6 +1,6 @@
#### configuration
-VERSION = 2.0pre
+VERSION = 2.0b3pre
NAME = vimperator
include ../common/Makefile.common
diff --git a/vimperator/NEWS b/vimperator/NEWS
index 65fb3371..ccda9cde 100644
--- a/vimperator/NEWS
+++ b/vimperator/NEWS
@@ -12,7 +12,7 @@
* IMPORTANT: Due to much improved autocompletion, changed default 'complete' option
value to 'sfl', listing intelligent Firefox location bar results. Removed possibility
to use 'h' in 'complete'.
- * IMPORTANT: AlwaysHint mode with ;F mode changed the semantics slightly
+ * IMPORTANT: AlwaysHint mode with ;F mode changed the semantics slightly.
* IMPORTANT: command actions now take an args object, returned from
commands.parseArgs, as their first argument. This will break any commands
not using the args parser explicitly. The old string value is now
@@ -20,10 +20,10 @@
* IMPORTANT: 'verbose' is now used for message levels. Logging is
controlled by the extensions.liberator.loglevel preference.
* IMPORTANT: :viusage and :exusage now jump to the help index, use the
- special versions for the old behavior
+ special versions for the old behavior.
* IMPORTANT: renamed Startup and Quit autocmd events to VimperatorEnter and
- VimperatorLeave respectively
- * IMPORTANT: 'verbose' is now by default at 1, set to 0 to not show any status messages
+ VimperatorLeave respectively.
+ * IMPORTANT: 'verbose' is now by default at 1, set to 0 to not show any status messages.
* IMPORTANT: $VIMPERATOR_HOME is no longer used.
* [count] now goes to the [count]th next tab rather than the [count]th tab.
@@ -58,7 +58,7 @@
* much improved completion support, including javascript, option, and search keyword
* add / and / command-line mappings for
selecting the previous and next history items
- * remove 'hintstyle', 'hlsearchstyle' and 'visualbellstyle' - use
+ * remove 'hintstyle', 'hlsearchstyle', 't_vb' and 'visualbellstyle' - use
:highlight {Hint,Search,Bell}
* add :highlight
* add :optionusage
@@ -86,6 +86,7 @@
* :qa! and :q! quit forcefully, as in vim
* stop macro playback on
* :bmark now updates a bookmark, if possible. :bmark! adds a new one
+ * :dialog and :sidebar arguments are now case-insensitive
* many bug fixes
2008-08-16:
@@ -151,7 +152,7 @@
2008-05-14:
* version 1.0
- * THIS VERSION ONLY WORKS WITH FIREFOX 3.0 beta3 or newer
+ * IMPORTANT: THIS VERSION ONLY WORKS WITH FIREFOX 3.0 beta3 or newer
* IMPORTANT: Major hints rewrite
read up the new help for the f, F and ; commands for details
removed the following hint options: 'hintchars' 'maxhints'
@@ -210,7 +211,7 @@
2007-12-21:
* version 0.5.3
- * IMPORTANT! options are no longer automatically stored - use the
+ * IMPORTANT: options are no longer automatically stored - use the
~/.vimperatorrc file instead for persistent options
* :tabnext and :tabprevious now accept an argument
* the count to gT now specifies a relative tab motion like Vim
@@ -379,7 +380,7 @@
* added 'n' and 'N' to repeat a search
* many small bug fixes
-17/04/2007:
+2007-04-17:
* version 0.3
* added Ctrl-v support to pass one key to firefox (patch by Muthu Kannan)
* also 'I' will go to 'ignorekeys' mode until esc is pressed, presenting a workaround
@@ -392,6 +393,6 @@
* ability to use shift and ctrl with special keys like F1 in mappings
* small documentation and other fixes
-11/04/2007:
+2007-04-11:
* version 0.2
* first public release
diff --git a/vimperator/TODO b/vimperator/TODO
index 7ee8644c..6abd5099 100644
--- a/vimperator/TODO
+++ b/vimperator/TODO
@@ -18,6 +18,10 @@ BUGS:
- :sidebar improvements (:sidebar! Downloads while downloads is open should refocus the sidebar)
- ;s saves the page rather than the image
- http://cgiirc.blitzed.org?chan=%23debug is unusable after login in
+- "g<" fails without a trailing escape because both "g<" and "g"
+ are mapped. Vimp should recognize "" as an atom that should not
+ be matched literally. In fact, typing "g" out literally is
+ equivalent to typing "g" and then .
(recent CVS regressions):
- :set noflashblock seems broken (= :set fb? afterwards says "fb"), let's see if that's a
@@ -29,10 +33,16 @@ BUGS:
=> it often overwrites the open command line while editing etc.
- and autocmd 'keywords' are not available when adding a
bookmark - they're being set after the observer triggers the autocmd event.
-- MOW is broken for multiple commands when open E.g. :ls | ls
+- MOW rendering is broken for multiple commands when open E.g. :ls | ls
- completion height is broken, try :a...., when it wraps it's totally off.
and even if it is not totally off, i had it jump by one pixel when wrapping around.
If that's unfixable, i propose reverting the new completion height stuff.
+- Windows paths have escaped backslashes in messages - presumably due to
+ String#quote change.
+- :messages is _very_ slow for message history of several thousand lines ->
+ Unresponsive Script: util.js:79 (sometimes xmlToDom() and elsewhere)
+- :hardcopy! seems to be broken for me
+- MOW hinting is broken, perhaps this should be properly disabled for 2.0
FEATURES:
9 finish :help TODOs
@@ -69,7 +79,7 @@ FEATURES:
google to another page and click 10 links there, [d would take me back to the google page
opera's fast forward does something like this
7 make an option to disable session saving by default when you close Firefox
-7 The output of the pageinfo-command sould contain the security-information of ssl-encrypted sites
+7 The output of the pageinfo-command should contain the security-information of ssl-encrypted sites
7 Add :every command
6 support private mode (and :set [no]private): http://ehsanakhgari.org/blog/2008-11-08/prepare-your-add-private-browsing
6 add [count] support to :b* and :tab* commands where missing
diff --git a/vimperator/content/bookmarks.js b/vimperator/content/bookmarks.js
index bd888b2f..f099b36e 100644
--- a/vimperator/content/bookmarks.js
+++ b/vimperator/content/bookmarks.js
@@ -711,7 +711,7 @@ function History() //{{{
if (url)
{
let sh = window.getWebNavigation().sessionHistory;
- for (let i in util.range(sh.index, 0, true))
+ for (let i in util.range(sh.index, 0, -1))
{
if (sh.getEntryAtIndex(i, false).URI.spec == url)
{
@@ -735,7 +735,7 @@ function History() //{{{
let sh = window.getWebNavigation().sessionHistory;
context.anchored = false;
- context.completions = [sh.getEntryAtIndex(i, false) for (i in util.range(sh.index, 0, true))];
+ context.completions = [sh.getEntryAtIndex(i, false) for (i in util.range(sh.index, 0, -1))];
context.keys = { text: function (item) item.URI.spec, description: "title" };
},
count: true,
@@ -1043,8 +1043,7 @@ function QuickMarks() //{{{
list: function list(filter)
{
- let marks = [key for ([key, val] in qmarks)];
- // This was a lot nicer without the lambda...
+ let marks = [k for ([k, v] in qmarks)];
let lowercaseMarks = marks.filter(function (x) /[a-z]/.test(x)).sort();
let uppercaseMarks = marks.filter(function (x) /[A-Z]/.test(x)).sort();
let numberMarks = marks.filter(function (x) /[0-9]/.test(x)).sort();
diff --git a/vimperator/content/config.js b/vimperator/content/config.js
index 7d4dd586..1a37841a 100644
--- a/vimperator/content/config.js
+++ b/vimperator/content/config.js
@@ -117,7 +117,7 @@ const config = { //{{{
"pattern.html", "tabs.html", "hints.html", "map.html", "eval.html",
"marks.html", "repeat.html", "autocommands.html", "print.html",
"gui.html", "styling.html", "message.html", "developer.html",
- "various.html", "index.html"
+ "various.html", "index.html", "version.html"
],
scripts: [
@@ -372,9 +372,10 @@ const config = { //{{{
function (args)
{
let arg = args.literalArg;
+ function compare(a, b) util.compareIgnoreCase(a, b) == 0
// focus if the requested sidebar is already open
- if (document.getElementById("sidebar-title").value == arg)
+ if (compare(document.getElementById("sidebar-title").value, arg))
{
document.getElementById("sidebar-box").focus();
return;
@@ -384,7 +385,7 @@ const config = { //{{{
for (let [,panel] in Iterator(menu.childNodes))
{
- if (panel.label == arg)
+ if (compare(panel.label, arg))
{
panel.doCommand();
return;
@@ -395,7 +396,11 @@ const config = { //{{{
},
{
argCount: "1",
- completer: function (context) completion.sidebar(context),
+ completer: function (context)
+ {
+ context.ignoreCase = true;
+ return completion.sidebar(context);
+ },
literal: 0
});
diff --git a/vimperator/contrib/vim/Makefile b/vimperator/contrib/vim/Makefile
new file mode 100644
index 00000000..e2f716f5
--- /dev/null
+++ b/vimperator/contrib/vim/Makefile
@@ -0,0 +1,9 @@
+VIMBALL = vimperator.vba
+
+vimball: mkvimball.txt syntax/vimperator.vim ftdetect/vimperator.vim
+ -echo '%MkVimball! ${VIMBALL} .' | vim -u NORC -N -e -s mkvimball.txt
+
+all: vimball
+
+clean:
+ rm -f ${VIMBALL}
diff --git a/vimperator/contrib/vim/ftdetect/vimperator.vim b/vimperator/contrib/vim/ftdetect/vimperator.vim
new file mode 100644
index 00000000..cbf9068e
--- /dev/null
+++ b/vimperator/contrib/vim/ftdetect/vimperator.vim
@@ -0,0 +1 @@
+au BufNewFile,BufRead *vimperatorrc*,*.vimp set filetype=vimperator
diff --git a/vimperator/contrib/vim/mkvimball.txt b/vimperator/contrib/vim/mkvimball.txt
new file mode 100644
index 00000000..96d1629b
--- /dev/null
+++ b/vimperator/contrib/vim/mkvimball.txt
@@ -0,0 +1,2 @@
+syntax/vimperator.vim
+ftdetect/vimperator.vim
diff --git a/vimperator/vimperator.vim b/vimperator/contrib/vim/syntax/vimperator.vim
similarity index 61%
rename from vimperator/vimperator.vim
rename to vimperator/contrib/vim/syntax/vimperator.vim
index 9a46884b..aebd6fc1 100644
--- a/vimperator/vimperator.vim
+++ b/vimperator/contrib/vim/syntax/vimperator.vim
@@ -1,7 +1,7 @@
" Vim syntax file
" Language: VIMperator configuration file
" Maintainer: Doug Kearns
-" Last Change: 2008 Dec 31
+" Last Change: 2009 Feb 19
if exists("b:current_syntax")
finish
@@ -18,19 +18,19 @@ unlet b:current_syntax
syn match vimperatorCommandStart "\%(^\s*:\=\)\@<=" nextgroup=vimperatorCommand,vimperatorAutoCmd
-syn keyword vimperatorCommand ab[breviate] ab[clear] addo[ns] b[uffer] ba[ck] bd[elete] beep bf[irst] bl[ast] bma[rk] bmarks
- \ bn[ext] bN[ext] bp[revious] br[ewind] buffers bun[load] bw[ipeout] ca[bbrev] cabc[lear] cd chd[ir] colo[rscheme] cuna[bbrev]
- \ cm[ap] cmapc[lear] cno[remap] comc[lear] com[mand] cu[nmap] do[autocmd] doautoa[ll] delbm[arks] delc[ommand] delmac[ros]
- \ delm[arks] delqm[arks] dels[tyle] dia[log] dl downl[oads] e[dit] ec[ho] echoe[rr] echom[sg] em[enu] exe[cute] exu[sage]
- \ fini[sh] files fo[rward] fw h[elp] ha[rdcopy] hi[ghlight] hist[ory] hs ia[bbrev] iabc[lear] im[ap] imapc[lear] ino[remap]
- \ iuna[bbrev] iu[nmap] javas[cript] ju[mps] js let loadplugins lpl ls macros ma[rk] map mapc[lear] marks mes[sages]
+syn keyword vimperatorCommand ab[breviate] ab[clear] addo[ns] bN[ext] b[uffer] ba[ck] bd[elete] beep bf[irst] bl[ast] bma[rk]
+ \ bmarks bn[ext] bp[revious] br[ewind] buffers bun[load] bw[ipeout] ca[bbrev] cabc[lear] cd chd[ir] cm[ap] cmapc[lear]
+ \ cno[remap] colo[rscheme] com[mand] comc[lear] cu[nmap] cuna[bbrev] delbm[arks] delc[ommand] delm[arks] delmac[ros]
+ \ delqm[arks] dels[tyle] dia[log] dl do[autocmd] doautoa[ll] downl[oads] e[dit] ec[ho] echoe[rr] echom[sg] em[enu] exe[cute]
+ \ exu[sage] files fini[sh] fo[rward] fw h[elp] ha[rdcopy] hi[ghlight] hist[ory] hs ia[bbrev] iabc[lear] im[ap] imapc[lear]
+ \ ino[remap] iu[nmap] iuna[bbrev] javas[cript] js ju[mps] let loadplugins lpl ls ma[rk] macros map mapc[lear] marks mes[sages]
\ mkv[imperatorrc] no[remap] noh[lsearch] norm[al] o[pen] optionu[sage] pa[geinfo] pagest[yle] pc[lose] pl[ay] pref[erences]
- \ prefs pw[d] q[uit] qa[ll] qma[rk] qmarks quita[ll] re[draw] re[load] reloada[ll] res[tart] run runt[ime] sty[le] sav[eas]
- \ sb[ar] sb[open] sbcl[ose] scrip[tnames] se[t] setg[lobal] setl[ocal] sideb[ar] so[urce] st[op] tN[ext] t[open] tab
- \ tabde[tach] tabd[uplicate] tabN[ext] tabc[lose] tabe[dit] tabfir[st] tabl[ast] tabm[ove] tabn[ext] tabnew tabo[nly] tabopen
+ \ prefs pw[d] q[uit] qa[ll] qma[rk] qmarks quita[ll] re[draw] re[load] reloada[ll] res[tart] run runt[ime] sav[eas] sb[ar]
+ \ sb[open] sbcl[ose] scrip[tnames] se[t] setg[lobal] setl[ocal] sideb[ar] so[urce] st[op] sty[le] tN[ext] t[open] tab
+ \ tabN[ext] tabc[lose] tabd[uplicate] tabde[tach] tabe[dit] tabfir[st] tabl[ast] tabm[ove] tabn[ext] tabnew tabo[nly] tabopen
\ tabp[revious] tabr[ewind] tabs time tn[ext] tp[revious] u[ndo] una[bbreviate] undoa[ll] unl[et] unm[ap] ve[rsion]
- \ vie[wsource] viu[sage] w[rite] wc[lose] win[open] winc[lose] wine[dit] wo[pen] wqa[ll] wq xa[ll] zo[om]
- \ contained
+ \ vie[wsource] viu[sage] w[rite] wc[lose] win[open] winc[lose] wine[dit] wo[pen] wq wqa[ll] xa[ll] zo[om]
+ \ contained
syn match vimperatorCommand "!" contained
@@ -45,11 +45,11 @@ syn match vimperatorAutoEventList "\(\a\+,\)*\a\+" contained contains=vimperator
syn region vimperatorSet matchgroup=vimperatorCommand start="\%(^\s*:\=\)\@<=\<\%(setl\%[ocal]\|setg\%[lobal]\|set\=\)\=\>"
\ end="$" keepend oneline contains=vimperatorOption,vimperatorString
-syn keyword vimperatorOption activate act alfc albc cdpath cd complete cpt defsearch ds editor extendedhinttags eht eventignore ei
- \ followhints fh guioptions go helpfile hf hintmatching hm hs hinttags ht hinttimeout hto history hi laststatus ls lbc lfc
- \ messages msgs newtab nextpattern pageinfo pa popups pps previewheight pvh previouspattern runtimepath rtp scroll scr shell
- \ sh shellcmdflag shcf showstatuslinks ssli showtabline stal suggestengines titlestring urlseparator verbose vbs t_vb wildcase
- \ wic wildignore wig wildmode wim wildoptions wop wordseparators wsp
+syn keyword vimperatorOption activate act cdpath cd complete cpt defsearch ds editor eventignore ei extendedhinttags eht
+ \ followhints fh guioptions go helpfile hf hintmatching hm hinttags ht hinttimeout hto history hi laststatus ls messages msgs
+ \ newtab nextpattern pageinfo pa popups pps previouspattern runtimepath rtp scroll scr shell sh shellcmdflag shcf
+ \ showstatuslinks ssli showtabline stal suggestengines titlestring urlseparator verbose vbs wildcase wic wildignore wig
+ \ wildmode wim wildoptions wop wordseparators wsp
\ contained nextgroup=vimperatorSetMod
" toggle options
@@ -66,12 +66,12 @@ syn match vimperatorSetMod "\%(\<[a-z_]\+\)\@<=&" contained
syn region vimperatorJavaScript start="\%(^\s*\%(javascript\|js\)\s\+\)\@<=" end="$" contains=@javascriptTop keepend oneline
syn region vimperatorJavaScript matchgroup=vimperatorJavascriptDelimiter
- \ start="\%(^\s*\%(javascript\|js\)\s\+\)\@<=<<\s*\z(\h\w*\)"hs=s+2 end="^\z1$" contains=@javascriptTop fold
+ \ start="\%(^\s*\%(javascript\|js\)\s\+\)\@<=<<\s*\z(\h\w*\)"hs=s+2 end="^\z1$" contains=@javascriptTop fold
let s:cssRegionStart = '\%(^\s*sty\%[le]!\=\s\+\%(-\%(n\|name\)\%(\s\+\|=\)\S\+\s\+\)\=[^-]\S\+\s\+\)\@<='
execute 'syn region vimperatorCss start="' . s:cssRegionStart . '" end="$" contains=@cssTop keepend oneline'
execute 'syn region vimperatorCss matchgroup=vimperatorCssDelimiter'
- \ 'start="' . s:cssRegionStart . '<<\s*\z(\h\w*\)"hs=s+2 end="^\z1$" contains=@cssTop fold'
+ \ 'start="' . s:cssRegionStart . '<<\s*\z(\h\w*\)"hs=s+2 end="^\z1$" contains=@cssTop fold'
syn match vimperatorNotation "<[0-9A-Za-z-]\+>"
@@ -85,15 +85,15 @@ syn match vimperatorLineComment +^\s*".*$+ contains=vimperatorTodo,@Spell
" NOTE: match vim.vim highlighting group names
hi def link vimperatorAutoCmd vimperatorCommand
hi def link vimperatorAutoEvent Type
-hi def link vimperatorCommand Statement
-hi def link vimperatorComment Comment
-hi def link vimperatorJavascriptDelimiter Delimiter
-hi def link vimperatorCssDelimiter Delimiter
-hi def link vimperatorNotation Special
-hi def link vimperatorLineComment Comment
-hi def link vimperatorOption PreProc
+hi def link vimperatorCommand Statement
+hi def link vimperatorComment Comment
+hi def link vimperatorJavascriptDelimiter Delimiter
+hi def link vimperatorCssDelimiter Delimiter
+hi def link vimperatorNotation Special
+hi def link vimperatorLineComment Comment
+hi def link vimperatorOption PreProc
hi def link vimperatorSetMod vimperatorOption
-hi def link vimperatorString String
+hi def link vimperatorString String
hi def link vimperatorTodo Todo
let b:current_syntax = "vimperator"
diff --git a/vimperator/locale/en-US/Makefile b/vimperator/locale/en-US/Makefile
deleted file mode 120000
index 85510a12..00000000
--- a/vimperator/locale/en-US/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../../../common/Makefile.doc
\ No newline at end of file
diff --git a/vimperator/locale/en-US/Makefile b/vimperator/locale/en-US/Makefile
new file mode 100644
index 00000000..627ca99b
--- /dev/null
+++ b/vimperator/locale/en-US/Makefile
@@ -0,0 +1,2 @@
+BASE = ../../../common
+include $(BASE)/Makefile.doc
diff --git a/vimperator/locale/en-US/asciidoc.conf b/vimperator/locale/en-US/asciidoc.conf
index ff6fda1e..4bcc4288 100644
--- a/vimperator/locale/en-US/asciidoc.conf
+++ b/vimperator/locale/en-US/asciidoc.conf
@@ -13,6 +13,7 @@ email=stubenschrott@gmx.net
+
{doctitle}
@@ -27,7 +28,7 @@ HEADER=