1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-03-04 14:05:49 +01:00

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

This commit is contained in:
Kris Maglione
2009-02-05 10:09:07 -05:00
8 changed files with 87 additions and 104 deletions

View File

@@ -9,5 +9,6 @@ $(TARGETS:%=\%.%):
echo MAKE $@ echo MAKE $@
$(MAKE) -C $* $(@:$*.%=%) $(MAKE) -C $* $(@:$*.%=%)
$(TARGETS): %: $(DIRS:%=%.%) $(TARGETS):
$(MAKE) $(DIRS:%=%.$@)

View File

@@ -573,7 +573,7 @@ function Commands() //{{{
count++; // to compensate the "=" character 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; invalid = true;
} }

View File

@@ -399,87 +399,51 @@ function Hints() //{{{
let wordSplitRegex = RegExp(options["wordseparators"]); let wordSplitRegex = RegExp(options["wordseparators"]);
// What the **** does this do? --Kris // 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) function charsAtBeginningOfWords(chars, words, allowWordOverleaping)
{ {
let charIdx = 0; function charMatches(charIdx, chars, wordIdx, words, inWordIdx, allowWordOverleaping)
let numMatchedWords = 0;
for (let [,word] in Iterator(words))
{ {
if (word.length == 0) let matches = (chars[charIdx] == words[wordIdx][inWordIdx]);
continue; if ((matches == false && allowWordOverleaping) || words[wordIdx].length == 0)
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 matchingStarted = false; let nextWordIdx = wordIdx + 1;
for (let i in util.range(numMatchedWords, charIdx)) if (nextWordIdx == words.length)
{ return false;
if (chars[i] == word[wcIdx])
{ return charMatches(charIdx, chars, nextWordIdx, words, 0, allowWordOverleaping);
matchingStarted = true;
wcIdx++;
}
else if (matchingStarted)
{
wcIdx = 0;
break;
}
}
} }
// the current word matches same characters as the previous word if (matches)
let prevCharIdx;
if (wcIdx > 0)
{ {
prevCharIdx = charIdx; let nextCharIdx = charIdx + 1;
// now check if it matches additional characters if (nextCharIdx == chars.length)
for (; wcIdx < word.length && charIdx < chars.length; wcIdx++, charIdx++) return true;
{
if (word[wcIdx] != chars[charIdx])
break;
}
// the word doesn't match additional characters, now check if the let nextWordIdx = wordIdx + 1;
// already matched characters are equal to the next characters for matching, let beyondLastWord = (nextWordIdx == words.length);
// if yes, then consume them let charMatched = false;
if (prevCharIdx == charIdx) if (beyondLastWord == false)
{ charMatched = charMatches(nextCharIdx, chars, nextWordIdx, words, 0, allowWordOverleaping)
for (let i = 0; i < wcIdx && charIdx < chars.length; i++, charIdx++)
{
if (word[i] != chars[charIdx])
break;
}
}
numMatchedWords++; if (charMatched)
} return true;
// 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 (prevCharIdx == charIdx) if (charMatched == false || beyondLastWord == true)
{ {
if (!allowWordOverleaping) let nextInWordIdx = inWordIdx + 1;
if (nextInWordIdx == words[wordIdx].length)
return false; return false;
return charMatches(nextCharIdx, chars, wordIdx, words, nextInWordIdx, allowWordOverleaping);
} }
else
numMatchedWords++;
} }
if (charIdx == chars.length) return false;
return true;
} }
return (charIdx == chars.length); return charMatches(0, chars, 0, words, 0, allowWordOverleaping);
} }
function stringsAtBeginningOfWords(strings, words, allowWordOverleaping) function stringsAtBeginningOfWords(strings, words, allowWordOverleaping)

View File

@@ -1274,7 +1274,8 @@ function CommandLine() //{{{
} }
else if (event.type == "input") 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); liberator.triggerCallback("change", currentExtendedMode, command);
} }
else if (event.type == "keypress") else if (event.type == "keypress")
@@ -1322,7 +1323,7 @@ function CommandLine() //{{{
else if (key == "<BS>") else if (key == "<BS>")
{ {
// reset the tab completion // reset the tab completion
this.resetCompletions(); //this.resetCompletions();
// and blur the command line if there is no text left // and blur the command line if there is no text left
if (command.length == 0) if (command.length == 0)
@@ -1333,7 +1334,7 @@ function CommandLine() //{{{
} }
else // any other key else // any other key
{ {
this.resetCompletions(); //this.resetCompletions();
} }
return true; // allow this event to be handled by Firefox return true; // allow this event to be handled by Firefox
} }
@@ -1758,7 +1759,7 @@ function ItemList(id) //{{{
</div> </div>
</div>, divNodes); </div>, divNodes);
doc.body.replaceChild(div, doc.body.firstChild); doc.body.replaceChild(div, doc.body.firstChild);
div.scrollIntoView(true); //div.scrollIntoView(true);
items.contextList.forEach(function init_eachContext(context) { items.contextList.forEach(function init_eachContext(context) {
delete context.cache.nodes; delete context.cache.nodes;
@@ -1941,7 +1942,7 @@ function ItemList(id) //{{{
if (index >= 0) if (index >= 0)
{ {
getCompletion(index).setAttribute("selected", "true"); getCompletion(index).setAttribute("selected", "true");
getCompletion(index).scrollIntoView(false); //getCompletion(index).scrollIntoView(false);
} }
//if (index == 0) //if (index == 0)

View File

@@ -995,12 +995,13 @@ function Mail() //{{{
// TODO: find out why, and solve the problem // TODO: find out why, and solve the problem
try try
{ {
var msgs = folder.getMessages(msgWindow); var msgs = folder.messages;
} }
catch (e) catch (e)
{ {
liberator.dump("ERROR: " + folder.prettyName + " failed to getMessages\n"); var msgs = folder.getMessages(msgWindow); // for older thunderbirds
continue; liberator.dump("WARNING: " + folder.prettyName + " failed to getMessages, trying old API");
//continue;
} }
while (msgs.hasMoreElements()) while (msgs.hasMoreElements())

View File

@@ -1,28 +1,28 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#"> <RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#">
<Description about="urn:mozilla:install-manifest"> <Description about="urn:mozilla:install-manifest">
<em:id>muttator@mozdev.org</em:id> <em:id>muttator@mozdev.org</em:id>
<em:name>Muttator</em:name> <em:name>Muttator</em:name>
<em:version>###VERSION###</em:version> <em:version>###VERSION###</em:version>
<em:description>Make Thunderbird behave like Vim</em:description> <em:description>Make Thunderbird behave like Vim</em:description>
<em:creator>Martin Stubenschrott</em:creator> <em:creator>Martin Stubenschrott</em:creator>
<em:homepageURL>http://vimperator.org/</em:homepageURL> <em:homepageURL>http://vimperator.org/</em:homepageURL>
<em:iconURL>chrome://muttator/skin/icon.png</em:iconURL> <em:iconURL>chrome://muttator/skin/icon.png</em:iconURL>
<em:file> <em:file>
<Description about="urn:mozilla:extension:file:vimperator.jar"> <Description about="urn:mozilla:extension:file:vimperator.jar">
<em:package>content/muttator/</em:package> <em:package>content/muttator/</em:package>
</Description> </Description>
</em:file> </em:file>
<em:targetApplication> <em:targetApplication>
<Description> <Description>
<em:id>{3550f703-e582-4d05-9a08-453d09bdfdc6}</em:id> <em:id>{3550f703-e582-4d05-9a08-453d09bdfdc6}</em:id>
<em:minVersion>3.0a1pre</em:minVersion> <em:minVersion>3.0b2pre</em:minVersion>
<em:maxVersion>3.0b2pre</em:maxVersion> <em:maxVersion>3.0b2</em:maxVersion>
</Description> </Description>
</em:targetApplication> </em:targetApplication>
</Description> </Description>
</RDF> </RDF>

View File

@@ -2,6 +2,11 @@ Contiuous donations:
* Daniel Bainton (web hosting) * Daniel Bainton (web hosting)
2009: 2009:
* David C Foor
* Oliver Schaefer
* Paul Moss
* Yongji Zhang
* Brian Peiris
* Peleg Michaeli ("Every hand revealed" from my amazon.de wishlist) * Peleg Michaeli ("Every hand revealed" from my amazon.de wishlist)
* InspireFocus * InspireFocus
* Michael Fremont * Michael Fremont

View File

@@ -18,6 +18,10 @@ BUGS:
- :sidebar improvements (:sidebar! Downloads while downloads is open should refocus the sidebar) - :sidebar improvements (:sidebar! Downloads while downloads is open should refocus the sidebar)
- ;s saves the page rather than the image - ;s saves the page rather than the image
- http://cgiirc.blitzed.org?chan=%23debug is unusable after login in - http://cgiirc.blitzed.org?chan=%23debug is unusable after login in
- "g<" fails without a trailing escape because both "g<" and "g<C-g>"
are mapped. Vimp should recognize "<C-g>" as an atom that should not
be matched literally. In fact, typing "g<C-g>" out literally is
equivalent to typing "g" and then <C-g>.
(recent CVS regressions): (recent CVS regressions):
- :set noflashblock seems broken (= :set fb? afterwards says "fb"), let's see if that's a - :set noflashblock seems broken (= :set fb? afterwards says "fb"), let's see if that's a
@@ -29,10 +33,15 @@ BUGS:
=> it often overwrites the open command line while editing etc. => it often overwrites the open command line while editing etc.
- <tags> and <keyword> autocmd 'keywords' are not available when adding a - <tags> and <keyword> autocmd 'keywords' are not available when adding a
bookmark - they're being set after the observer triggers the autocmd event. 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<tab>....<tab>, when it wraps it's totally off. - completion height is broken, try :a<tab>....<tab>, 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. 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. 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
FEATURES: FEATURES:
9 finish :help TODOs 9 finish :help TODOs
@@ -40,6 +49,8 @@ FEATURES:
9 adaptive timeout for auto-completions, :set completions can be updated more often than 9 adaptive timeout for auto-completions, :set completions can be updated more often than
:open foo :open foo
9 use the storage module for autocommands 9 use the storage module for autocommands
9 the NEWS file should be more easily available for users, via :help news or something
at the moment you need to unzip the xpi or check the sources to view it, which isn't user friendly
8 support 'activate' in buffer.followLink? 8 support 'activate' in buffer.followLink?
Leave this to the bookmarks.tabs.loadInBackground. Hint activation Leave this to the bookmarks.tabs.loadInBackground. Hint activation
should be nearly equivalent to the corresponding mouse motion, and that should be nearly equivalent to the corresponding mouse motion, and that
@@ -69,7 +80,7 @@ FEATURES:
google to another page and click 10 links there, [d would take me back to the google page 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 opera's fast forward does something like this
7 make an option to disable session saving by default when you close Firefox 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 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 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 6 add [count] support to :b* and :tab* commands where missing