diff --git a/NEWS b/NEWS index d9527629..679d7647 100644 --- a/NEWS +++ b/NEWS @@ -1,13 +1,15 @@
2007-xx-xx: * version 0.6 - * THIS VERSION ONLY WORKS WITH FIREFOX 3.0 - * IMPORTANT! options are no longer automatically stored - use the + * THIS VERSION ONLY WORKS WITH FIREFOX 3.0 beta1 or newer + * IMPORTANT: options are no longer automatically stored - use the ~/.vimperatorrc file instead for persistent options - * IMPORTANT! Major hints rewrite + * IMPORTANT: Major hints rewrite read up the new help for the f, F and ; commands for details removed the following hint options: 'hintchars' 'maxhints' added the following hint options: 'hinttimeout' + * IMPORTANT: changed 'I' key to Ctrl-Q to also work in textboxes + * new ctrl-x and ctrl-a mappings to increment the last number in the URL * new ~ mapping to open the home directory * :open tries to open a relative filename now, if you do a :open foo.html or :open ../hello.txt; @@ -24,7 +26,6 @@ * tags and keyword support for :bmark * added full zoom, and changed keybindings slightly for text zoom * improvements for scrollable -- more -- prompt - * changed 'I' key to Ctrl-Q to also work in textboxes * sites like msn.com or yahoo.com don't focus search field anymore on keydown * new gi browser command to focus last used input box * edit TEXTAREAs with many vim commands in a vim and even visual mode if you :set noinsertmode diff --git a/TODO b/TODO index 404251d5..7c91dca7 100644 --- a/TODO +++ b/TODO @@ -40,9 +40,6 @@ RANDOM IDEAS: * numbered tabs * Would it be possible to add a setting "maxcompletionsshown" and "maxpreviewwindowheight" or something like this? -* 16:06:04 bartman| maxauthority: feature idea: what if :n and :N searched the - page and if they found a unique href=*next.* or - href=.*prev.* they would follow that link? * hide scrollbars: http://rafb.net/p/YHRhEe47.html (window.content.document.body.style.overflow = "hidden")diff --git a/content/io.js b/content/io.js index fcd0c2ae..3e5a5e10 100644 --- a/content/io.js +++ b/content/io.js @@ -173,7 +173,7 @@ vimperator.IO = function () //{{{ if (!/^(file:|[a-zA-Z]:|\/)/.test(path)) // starts not with either /, C: or file: path = this.getCurrentDirectory() + (WINDOWS ? "\\" : "/") + path; // TODO: for now homedir, later relative to current dir? else - path = path.replace(/^file:/, ""); + path = path.replace(/^file:(\/\/)?/, ""); file.initWithPath(path); return file; diff --git a/content/mappings.js b/content/mappings.js index 49dde1ac..c499b76b 100644 --- a/content/mappings.js +++ b/content/mappings.js @@ -872,6 +872,44 @@ vimperator.Mappings = function () //{{{ "Works like
:xall."
}
));
+ function incrementURL(count)
+ {
+ var url = vimperator.buffer.URL;
+ var regex = /(.*?)(-?\d+)(\D*)$/;
+
+ var res = url.match(regex);
+ if(!res || !res[2]) // no number to increment
+ {
+ vimperator.beep();
+ return;
+ }
+
+ var newNum = parseInt(res[2], 10) + count + ""; // "" to make sure its a string
+ var nums = newNum.match(/^(-?)(\d+)$/);
+ var oldLength = res[2].replace(/-/, "").length, newLength = nums[2].length;
+ newNum = nums[1] || "";
+ for (let i = 0; i < oldLength - newLength; i++)
+ newNum += "0"; // keep leading zeros
+ newNum += nums[2];
+
+ vimperator.open(res[1] + newNum + res[3]);
+ }
+ addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ["count if given.",
+ flags: vimperator.Mappings.flags.COUNT
+ }
+ ));
+ addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ["count if given.",
+ flags: vimperator.Mappings.flags.COUNT
+ }
+ ));
// scrolling commands
addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ["0", "^"],
@@ -1042,37 +1080,44 @@ vimperator.Mappings = function () //{{{
flags: vimperator.Mappings.flags.COUNT
}
));
- function isDirectory(url)
- {
- if (/^file:\/\/|^\//.test(url))
- {
- var strippedFilename = url.replace(/^(file:\/\/)?(.*)/, "$2");
- var file = vimperator.io.getFile(strippedFilename);
- if (!file || !file.isDirectory())
- return false;
- else
- return true;
- }
-
- // for all other locations just check if the URL ends with /
- return /\/$/.test(url);
- }
- addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ["gu", "gU on http://www.example.com/dir1/dir2/file.htm opens http://www.example.com/.