diff --git a/Makefile b/Makefile index fbaa8e6a..8089e761 100644 --- a/Makefile +++ b/Makefile @@ -15,7 +15,7 @@ ZIP = zip # find the vimperator chrome dir FIREFOX_DEFAULT = $(wildcard ${HOME}/.mozilla/firefox/*.default) -VIMPERATOR_CHROME = $(wildcard ${FIREFOX_DEFAULT}/extensions/{f9570b26-e246-4753-9b68-61aa95994237}/chrome/) +VIMPERATOR_CHROME = $(wildcard ${FIREFOX_DEFAULT}/extensions/vimperator@mozdev.org/chrome/) # specify V=1 on make line to see more verbose output Q=$(if ${V},,@) diff --git a/chrome/content/vimperator/commands.js b/chrome/content/vimperator/commands.js index 951cea60..eeebdb1e 100644 --- a/chrome/content/vimperator/commands.js +++ b/chrome/content/vimperator/commands.js @@ -30,187 +30,201 @@ the terms of any one of the MPL, the GPL or the LGPL. * format: * [ * 0: [all names of this command], - * 1: description, + * 1: usage, * 2: helptext - * 3: function (arguments in this order: args, special, count) + * 3: function (arguments in this order: args, special, count, modifiers) * 4: completefunc * ] */ var g_commands = [/*{{{*/ [ ["addons"], - "Show available Browser Extensions and Themes", - "You can add/remove/disable browser extensions from this dialog.
Be aware that not all Firefox extensions work, because Vimperator overrides some keybindings and changes Firefox's GUI.", + ["addons"], + "Show available Browser Extensions and Themes
" + + "You can add/remove/disable browser extensions from this dialog.
Be aware that not all Firefox extensions work, because Vimperator overrides some keybindings and changes Firefox's GUI.", function() { openURLsInNewTab("chrome://mozapps/content/extensions/extensions.xul", true); }, null ], [ ["back", "ba"], - "Go back in the browser history", - "Count is supported, :3back goes back 3 pages in the browser history.
"+ + ["{count}ba[ck][!]"], + "Go back in the browser history
" + + "Count is supported, :3back goes back 3 pages in the browser history.
"+ "The special version :back! goes to the beginning of the browser history.", function(args, special, count) { if(special) historyGoToBeginning(); else stepInHistory(count > 0 ? -1 * count : -1); }, null ], [ ["bdelete", "bd", "bwipeout", "bw", "bunload", "bun", "tabclose", "tabc"], - "Delete current buffer (=tab)", - "Count WILL be supported in future releases, then :2bd removes two tabs and the one the right is selected.
Do :bdelete! to select the tab to the left after removing the current tab.", + ["{count}bd[elete][!]"], + "Delete current buffer (=tab)
"+ + "Count WILL be supported in future releases, then :2bd removes two tabs and the one the right is selected.
Do :bdelete! to select the tab to the left after removing the current tab.", function (args, special, count) { tab_remove (count, special, 0); }, null ], [ + ["beep"], ["beep"], "Play a system beep", - null, beep, null ], [ ["bmadd"], - "Add a bookmark", - "Usage: :bmadd [-t \"my custom title\"] [-T \"comma,separated,tags\"] [url]
" + - "If you don't add a custom title, either the title of the webpage or the URL will be taken as the title.
"+ - "Tags WILL be some mechanism to classify bookmarks. Assume, you tag a url with the tags \"linux\" and \"computer\" you'll be able to search for bookmarks containing these tags.
" + + ["bmadd [-t \"my custom title\"] [-T \"comma,separated,tags\"] [url]"], + "Add a bookmark
" + + "If you don't add a custom title, either the title of the webpage or the URL will be taken as the title.
" + + "Tags WILL be some mechanism to classify bookmarks. Assume, you tag a url with the tags \"linux\" and \"computer\" you'll be able to search for bookmarks containing these tags.
" + "You can omit the optional [url] field, so just do :bmadd to bookmark the currently loaded web page with a default title and without any tags.", bmadd, null ], [ ["bmdel"], - "Delete a bookmark", - "Usage: :bmdel [-T \"comma,separated,tags\"] <url>
" + + ["bmdel [-T \"comma,separated,tags\"] {url}"], + "Delete a bookmark
"+ "Deletes all bookmarks which matches the url AND the specified tags. Use <Tab> key on a regular expression to complete the url which you want to delete.", bmdel, function(filter) { return get_bookmark_completions(filter); } ], [ ["bookmarks", "bm"], - "Show bookmarks", - "Usage: :bm [-T \"comma,separated,tags\"] <regexp>
" + - "Open the preview window at the bottom of the screen for all bookmarks which match the regexp either in the title or URL.
" + + ["bm[!] [-T \"comma,separated,tags\"] {regexp}"], + "Show bookmarks
" + + "Open the preview window at the bottom of the screen for all bookmarks which match the regexp either in the title or URL.
" + "Close this window with :pclose or open entries with double click in the current tab or middle click in a new tab.", bmshow, function(filter) { return get_bookmark_completions(filter); } ], - [ + [ ["buffer", "b"], + ["b[uffer]"], "Go to buffer number n. Full completion works.", - null, function (args) { tab_go(args.split(":")[0]); }, function (filter) {return get_buffer_completions(filter);} ], [ ["buffers", "files", "ls"], + ["buffers"], "Shows a list of all buffers.", - null, function (args) {bufshow("", false);}, null ], [ ["downloads", "dl"], - "Show progress of current downloads", - "Open the original Firefox download dialog in a new tab.
" + + ["downloads"], + "Show progress of current downloads
" + + "Open the original Firefox download dialog in a new tab.
" + "Here, downloads can be paused, canceled and resumed.", function() { openURLsInNewTab("chrome://mozapps/content/downloads/downloads.xul", true); }, null ], [ ["echo", "ec"], - "Display a string at the bottom of the window", - "Echo all arguments of this command. Useful for showing informational messages.
Multiple lines WILL be seperated by \\n.", + ["ec[ho]"], + "Display a string at the bottom of the window
" + + "Echo all arguments of this command. Useful for showing informational messages.
Multiple lines WILL be seperated by \\n.", echo, null ], [ ["echoerr", "echoe"], - "Display an error string at the bottom of the window", - "Echo all arguments of this command highlighted in red. Useful for showing important messages.
Multiple lines WILL be seperated by \\n.", + ["echoe[rr]"], + "Display an error string at the bottom of the window
", + "Echo all arguments of this command highlighted in red. Useful for showing important messages.
Multiple lines WILL be seperated by \\n.", echoerr, null ], [ ["execute", "exe"], - "Executes a string as an Ex command", - "Usage: :execute {expr1} [ ... ]
" + - "Executes the string that results from the evaluation of {expr1} as an Ex command.
"+ - ":execute "echo test" would show a message with the text "test".
", + ["exe[cute] {expr1} [ ... ]"], + "Executes the string that results from the evaluation of {expr1} as an Ex command.
"+ + ":execute "echo test" would show a message with the text "test".
", execute, null ], [ ["forward", "fw"], - "Go forward in the browser history", - "Count is supported, :3forward goes forward 3 pages in the browser history.
"+ - "The special version :back! goes to the beginning of the browser history.", + ["{count}forward[!]"], + "Go forward in the browser history
" + + "Count is supported, :3forward goes forward 3 pages in the browser history.
"+ + "The special version :forward! goes to the end of the browser history.", function(args, special, count) { if(special) historyGoToEnd(); else stepInHistory(count > 0 ? count : 1); }, null ], [ ["hardcopy", "ha"], - "Print current document", + ["ha[rdcopy]"], + "Print current document
" + "Open a GUI dialog where you can select the printer, number of copies, orientation, etc.", function() { goDoCommand('cmd_print'); }, null ], [ ["help", "h"], - "Open help window", - "Open the help window in the current tab. You WILL be able to show a specific section with :help commands.", + ["h[elp] {subject}"], + "Open the help window in the current tab. It can jump to the specified {subject} with :help {subject}.", help, function(filter) { return get_help_completions(filter); } ], [ ["history", "hs"], - "Show recently visited URLs", - "Usage: :hs <regexp>
" + - "Open the preview window at the bottom of the screen for all history items which match the regexp either in the title or URL.
" + + ["hs {regexp}"], + "Show recently visited URLs
" + + "Open the preview window at the bottom of the screen for all history items which match the regexp either in the title or URL.
" + "Close this window with :pclose or open entries with double click in the current tab or middle click in a new tab.", hsshow, function(filter) { return get_history_completions(filter); } ], [ ["javascript", "js"], - "Run any javascript command through eval()", - "Acts as a javascript interpreter by passing the argument to eval().
" + - ":javascript alert('Hello world') would show a dialog box with the text \"Hello world\".
" + - ":javascript <<EOF would read all the lines until a line starting with 'EOF' is found, and will eval() them.
" + + ["javascript {cmd}", "javascript <<{endpattern}
{script}
{endpattern}"], + "Run any javascript command through eval()
" + + "Acts as a javascript interpreter by passing the argument to eval().
" + + ":javascript alert('Hello world') would show a dialog box with the text \"Hello world\".
" + + ":javascript <<EOF would read all the lines until a line starting with 'EOF' is found, and will eval() them.
" + "The special version :javascript! will open the javascript console of Firefox.", function(args, special) { if (special) // open javascript console openURLsInNewTab("chrome://global/content/console.xul", true); else - eval(args); + try { + eval(args); + } catch(e) { + echoerr(e.name + ": " + e.message); + } }, null ], [ - ["mark"], - "Mark current location within the webpage", + ["mark", "ma"], + ["ma[rk] {arg}"], + "Mark current location within the webpage
" + "Not implemented yet", - function (args) { set_location_mark(args); }, + set_location_mark, null ], [ ["marks"], - "Show all location marks of current webpage", + ["marks {arg}"], + "Show all location marks of current webpage
" + "Not implemented yet", - function (args) { set_location_mark(args); }, + set_location_mark, null ], [ - ["open", "o", "op", "edit", "e"], - "Open one ore more URLs", - "Usage: :open <url> [| <url>]
" + - "Opens one ore more URLs in the current buffer.
"+ - "Multiple URLs can be separated with the | character.
" + - "Each |-separated token is analazed and in this order:
"+ + ["edit", "e", "open", "op", "o"], + ["edit [url] [| [url]]"], + "Open one ore more URLs
" + + "Opens one ore more URLs in the current buffer.
"+ + "Multiple URLs can be separated with the | character.
" + + "Each |-separated token is analazed and in this order:
"+ "
  1. Opened with the specified search engine if the token looks like a search string and the first word of the token is the name of a search engine (:open wiki linus torvalds will open the wikipedia entry for linux torvalds).
  2. "+ "
  3. Opened with the default search engine if the first word is no search engine (:open linus torvalds will open a google search for linux torvalds).
  4. "+ "
  5. Passed directly to Firefox in all other cases (:open www.osnews.com | www.slashdot.org will open OSNews in the current, and Slashdot in a new background tab).
"+ - "You WILL be able to use :open [-T \"linux\"] torvalds<Tab> to complete bookmarks with tag \"linux\" and which contain \"torvalds\". Note that -T support is only available for tab completion, not for the actual command.
"+ - "The items which are completed on <Tab> are specified in the 'complete' option.
"+ - "Without argument, reloads the current page.
"+ + "You WILL be able to use :open [-T \"linux\"] torvalds<Tab> to complete bookmarks with tag \"linux\" and which contain \"torvalds\". Note that -T support is only available for tab completion, not for the actual command.
"+ + "The items which are completed on <Tab> are specified in the 'complete' option.
"+ + "Without argument, reloads the current page.
"+ "Without argument but with !, reloads the current page skipping the cache.", function(args, special) { @@ -229,150 +243,174 @@ var g_commands = [/*{{{*/ ], [ ["pclose", "pc"], + ["pc[lose]"], "Close preview window on bottom of screen", - null, function() { preview_window.hidden = true; }, null ], [ ["preferences", "prefs"], - "Show Browser Preferences", - "You can change the browser preferences from this dialog.
Be aware that not all Firefox preferences work, because Vimperator overrides some keybindings and changes Firefox's GUI.
"+ + ["preferences"], + "Show Browser Preferences
" + + "You can change the browser preferences from this dialog.
Be aware that not all Firefox preferences work, because Vimperator overrides some keybindings and changes Firefox's GUI.
"+ "Works like :set!, but opens the dialog in a new window instead of a new tab. Use this, if you experience problems/crashes when using :set!", openPreferences, null ], [ ["quit", "q"], - "Quit current tab or quit Vimperator if this was the last tab", + ["q[uit]"], + "Quit current tab or quit Vimperator if this was the last tab
" + "When quitting Vimperator, the session is not stored.", function (args) { tab_remove(1, false, 1); }, null ], [ ["quitall", "quita", "qall", "qa"], - "Quit Vimperator", + ["quita[ll]"], "Quit Vimperator, no matter how many tabs/windows are open. The session is not stored.", function (args) { quit(false); }, null ], [ ["reload", "re"], - "Reload current page", + ["re[load]"], + "Reload current page
" + "Forces reloading of the current page, or of all open pages, if ! is given.", function(args, special) { reload(special); }, null ], [ ["restart"], - "Restarts the browser", + ["restart"], "Forces the browser to restart.", restart, null ], [ ["saveas", "sav"], - "Save current web page to disk", - "Open the original Firefox \"Save page as...\" dialog in a new tab.
" + + ["sav[eas]"], + "Save current web page to disk
" + + "Open the original Firefox \"Save page as...\" dialog in a new tab.
" + "There, you can save the current web page to disk with various options.", function() { goDoCommand('Browser:SavePage'); }, null ], [ ["set", "se"], - "Set an option", - "Permanently change an option. In contrast to Vim options are stored throughout sessions.
"+ - "Boolean options must be set with :set option and :set nooption.
"+ - ":set without an argument opens about:config in a new tab to change advanced Firefox options.
"+ - ":set! opens the GUI preference panel from Firefox in a new tab.
"+ - ":set option? or :set option shows the current value of the option.
"+ - ":set option+=foo and :set option-=foo WILL add/remove foo from list options.
", + ["se[t][!]", "se[t] {option}[?]", "se[t] {option}[+-]={value}"], + "Set an option
" + + "Permanently change an option. In contrast to Vim options are stored throughout sessions.
"+ + "Boolean options must be set with :set option and :set nooption.
"+ + ":set without an argument opens about:config in a new tab to change advanced Firefox options.
"+ + ":set! opens the GUI preference panel from Firefox in a new tab.
"+ + ":set option? or :set option shows the current value of the option.
"+ + ":set option+=foo and :set option-=foo WILL add/remove foo from list options.
", set, function(filter) { return get_settings_completions(filter); } ], [ ["source", "so"], - "Load a local javascript file and execute it", - "The .vimperatorrc file in your home directory is always sourced at start up.
"+ - "~ is supported as a shortcut for the $HOME directory.", + [":so[urce][!] {file}"], + "Read Ex commands from {file}
" + + "The .vimperatorrc file in your home directory is always sourced at start up.
"+ + "~ is supported as a shortcut for the $HOME directory.
" + + "If ! is specified, errors are not printed.", source, function (filter) { return get_file_completions(filter); } ], [ - ["tabnext", "tn", "tnext"], - "Switch to the next tab", + ["tab"], + ["tab {cmd}"], + "Executes {cmd} and tells it to output in a new tab. Works for commands that support it.
" + + "Example: :tab help tab Opens the help in a new tab.", + tab, + null, + ], + [ + ["tabnext", "tabn", "tn", "tnext"], + ["tabn[ext]"], + "Switch to the next tab
" + "Cycles to the first tab, when the last is selected.", function(args, special, count) { tab_go(0); }, null ], [ - ["tabopen", "t", "to", "topen", "tabedit", "tabe", "tabnew"], - "Open one or more URLs in a new tab", + ["tabedit", "tabe", "tabnew", "tabopen", "t", "to", "topen"], + ["tabedit [url] [| [url]]"], + "Open one or more URLs in a new tab
" + "Like :open but open URLs in a new tab. If used with !, the 'tabopen' value of the 'activate' setting is negated.", function (args, special) { if (args.length > 0) openURLsInNewTab(args, !special); else openURLsInNewTab("about:blank", true); }, function (filter) { return get_url_completions(filter); } ], [ ["tabprevious", "tp", "tprev", "tprevious"], - "Switch to the previous tab", + ["tabp[revious]"], + "Switch to the previous tab
" + "Cycles to the last tab, when the first is selected.", function(args, count) { tab_go(-1); }, null ], [ ["undo", "u"], - "Undo closing of a tab", + ["{count}undo"], + "Undo closing of a tab
" + "If a count is given, don't close the last but the n'th last tab", function(args, special, count) { if(count < 1) count = 1; undoCloseTab(count-1); }, null ], [ ["qmarkadd", "qmadd"], - "Mark a URL with a letter for quick access", + ["qmarkadd"], + "Mark a URL with a letter for quick access
" + "Not implemented yet", function(args) { set_url_mark("mark", "url"); }, // FIXME function(filter) { return [["a", ""], ["b", ""]]; } ], [ ["qmarkdel", "qmdel"], - "Mark a URL with a letter for quick access", + ["qmarkdel"], + "Mark a URL with a letter for quick access
" + "Not implemented yet", function(args) { set_url_mark("mark", "url"); }, // FIXME function(filter) { return [["a", ""], ["b", ""]]; } ], [ ["qmarks", "qms"], - "Shows marked URLs", + ["qmarks"], + "Shows marked URLs
" + "Not implemented yet", function(args) { show_url_marks(args); }, // FIXME null ], [ ["version", "ve"], + ["ve[rsion]"], "Show version information", - null, function () { echo("Vimperator version: " + g_vimperator_version); }, null ], [ - ["winopen", "w", "wo", "wopen"], - "Open an URL in a new window", + ["winedit", "wine", "winopen", "w", "wo", "wopen"], + ["wine[dit] [url] [| [url]]"], + "Open an URL in a new window
" + "Not implemented yet", function () { echo("winopen not yet implemented"); }, null ], [ ["xall", "xa", "wqall", "wqa", "wq"], - "Save the session and quit", + ["wqa[ll]", "xa[ll]"], + "Save the session and quit
" + "Quit Vimperator, no matter how many tabs/windows are open. The session is stored.", function (args) { quit(true); }, null ], [ ["zoom", "zo"], - "Set zoom value of the webpage", - "Usage: :zoom 150 zooms to 150% text size.
"+ - "Zoom value can be between 25 and 500%. If it is omitted, zoom is reset to 100%.", + ["zo[om] {value}"], + "Set zoom value of the webpage
" + + "{value} can be between 25 and 500%. If it is omitted, zoom is reset to 100%.", zoom_to, null ] @@ -382,7 +420,7 @@ var g_commands = [/*{{{*/ * format: * [ * 0: [all shortcuts of this command], - * 1: description, + * 1: usage, * 2: helptext * 3: function (arguments in this order: args, special, count) * ] @@ -390,182 +428,201 @@ var g_commands = [/*{{{*/ var g_mappings = [/*{{{*/ [ ["]f"], - "Focus next frame", - "Flashes the next frame in order with a red color, to quickly show where keyboard focus is.
"+ + ["]f"], + "Focus next frame
" + + "Flashes the next frame in order with a red color, to quickly show where keyboard focus is.
"+ "This may not work correctly for frames with lots of CSS code.", focusNextFrame ], [ ["b"], - "Open a prompt to switch buffers", + ["b {number}"], + "Open a prompt to switch buffers
" + "Typing the corresponding number opens switches to this buffer", function (args) { bufshow("", true); openVimperatorBar('buffer '); } ], [ ["B"], - "Toggle buffer list", - "Toggle the preview window with all currently opened tabs.", - buffer_preview_toggle, + ["B"], + "Toggle the buffer list with all currently opened tabs.", + buffer_preview_toggle ], [ ["d"], - "Delete current buffer (=tab)", + ["{count}d"], + "Delete current buffer (=tab)
" + "Count WILL be supported in future releases, then 2d removes two tabs and the one the right is selected.", function(count) { tab_remove(count, false, 0); } ], [ ["D"], - "Delete current buffer (=tab)", + ["{count}D"], + "Delete current buffer (=tab)
" + "Count WILL be supported in future releases, then 2D removes two tabs and the one the left is selected.", function(count) { tab_remove(count, true, 0); } ], [ ["ge"], - "Execute a JavaScript code", - "Go Execute works like :execute.
"+ + ["ge {cmd}"], + "Execute an Ex command
" + + "Go Execute works like :execute.
"+ "This mapping is for debugging purposes, and may be removed in future.", function(count) { openVimperatorBar('execute '); } ], [ ["gh"], - "Go home", + ["gh"], + "Go home
" + "Opens the homepage in the current tab.", BrowserHome ], [ ["gH"], - "Go home in a new tab", + ["gH"], + "Go home in a new tab
" + "Opens the homepage in a new tab.", function(count) { openURLsInNewTab("", true); BrowserHome(); } ], [ ["gP"], - "Open (put) an URL based on the current Clipboard contents in a new buffer", + ["gP"], + "Open (put) an URL based on the current Clipboard contents in a new buffer
" + "Works like P, but inverts the 'activate' setting.", function(count) { openURLsInNewTab(readFromClipboard(), false); } ], [ ["gt", "", ""], - "Go to next tab", - "Cycles to the first tab, when the last is selected.
"+ + ["{count}gt"], + "Go to next tab
" + + "Cycles to the first tab, when the last is selected.
"+ "Count is supported, 3gt goes to the third tab.", function(count) { tab_go(count > 0 ? count : 0); } ], [ ["gT", "", ""], - "Go to previous tab", - "Cycles to the last tab, when the first is selected.
"+ + ["{count}gT"], + "Go to previous tab
" + + "Cycles to the last tab, when the first is selected.
"+ "Count is supported, 3gt goes to the third tab.", function(count) { tab_go(count > 0 ? count :-1); } ], [ ["o"], - "Open one or more URLs in the current tab", + ["o"], + "Open one or more URLs in the current tab
" + "See :open for more details", function(count) { openVimperatorBar('open '); } ], [ ["O"], - "Open one ore more URLs in the current tab, based on current location", + ["O"], + "Open one ore more URLs in the current tab, based on current location
" + "Works like o, but preselects current URL in the :open query.", function(count) { openVimperatorBar('open ' + getCurrentLocation()); } ], [ ["p", ""], - "Open (put) an URL based on the current Clipboard contents in the current buffer", + ["p", ""], + "Open (put) an URL based on the current Clipboard contents in the current buffer
" + "You can also just select some non-URL text, and search for it with the default search engine with p", function(count) { openURLs(readFromClipboard()); } ], [ ["P"], - "Open (put) an URL based on the current Clipboard contents in a new buffer", - "Works like p, but opens a new tab.
"+ + ["P"], + "Open (put) an URL based on the current Clipboard contents in a new buffer
" + + "Works like p, but opens a new tab.
"+ "Whether the new buffer is activated, depends on the 'activate' setting.", function(count) { openURLsInNewTab(readFromClipboard(), true); } ], [ ["r"], - "Reload current page", + ["r"], "Forces reloading of the current page.", function(count) { reload(false); } ], [ ["R"], - "Reload all pages", + ["R"], "Forces reloading of all open pages.", function(count) { reload(true); } ], [ ["t"], - "Open one or more URLs in a new tab", + ["t"], + "Open one or more URLs in a new tab
" + "Like o but open URLs in a new tab."+ "See :tabopen for more details", function(count) { openVimperatorBar('tabopen '); } ], [ ["T"], - "Open one ore more URLs in a new tab, based on current location", + ["T"], + "Open one ore more URLs in a new tab, based on current location
" + "Works like t, but preselects current URL in the :tabopen query.", function(count) { openVimperatorBar('tabopen ' + getCurrentLocation()); } ], [ ["u"], - "Undo closing of a tab", + ["{count}u"], + "Undo closing of a tab
" + "If a count is given, don't close the last but the n'th last tab", function(count) { execute_command(count, 'undo', false, ''); } ], [ ["y"], - "Yank current location to the Clipboard", + ["y"], + "Yank current location to the Clipboard
" + "Under UNIX the location is also put into the selection, which can be pasted with the middle mouse button.", yankCurrentLocation ], [ ["zi", "+"], - "Zoom in", - "Zoom in current web page by 25%.
"+ + ["zi", "+"], + "Zoom in current web page by 25%.
"+ "Currently no count supported.", function(count) { zoom_in(1); } ], [ ["zI"], - "Zoom in more", - "Zoom in current web page by 100%.
"+ + ["zI"], + "Zoom in current web page by 100%.
"+ "Currently no count supported.", function(count) { zoom_in(4); } ], [ ["zo", "-"], - "Zoom out", - "Zoom out current web page by 25%.
"+ + ["zo", "-"], + "Zoom out current web page by 25%.
"+ "Currently no count supported.", function(count) { zoom_in(-1); } ], [ ["zO"], - "Zoom out more", - "Zoom out current web page by 100%.
"+ + ["zO"], + "Zoom out current web page by 100%.
"+ "Currently no count supported.", function(count) { zoom_in(-4); } ], [ ["zz"], - "Set zoom value of the webpage", - "150zz zooms to 150% text size.
"+ + ["{count}zz"], + "Set zoom value of the webpage
" + "Zoom value can be between 25 and 500%. If it is omitted, zoom is reset to 100%.", zoom_to ], [ ["ZQ"], - "Quit Vimperator", - "Quit Vimperator, no matter how many tabs/windows are open. The session is not stored.
" + + ["ZQ"], + "Quit Vimperator, no matter how many tabs/windows are open. The session is not stored.
" + "Works like :qall.", function(count) { quit(false); } ], [ ["ZZ"], - "Save the session and quit", - "Quit Vimperator, no matter how many tabs/windows are open. The session is stored.
" + + ["ZZ"], + "Save the session and quit
" + + "Quit Vimperator, no matter how many tabs/windows are open. The session is stored.
" + "Works like :xall.", function(count) { quit(true); } ], @@ -573,65 +630,72 @@ var g_mappings = [/*{{{*/ /* scrolling commands */ [ ["0", "^"], - "Scroll to the absolute left of the document", + ["0", "^"], + "Scroll to the absolute left of the document
" + "Unlike in vim, 0 and ^ work exactly the same way.", function(count) { scrollBufferAbsolute(0, -1); } ], [ + ["$"], ["$"], "Scroll to the absolute right of the document", - null, function(count) { scrollBufferAbsolute(100, -1); } ], [ ["gg", ""], - "Goto the top of the document", + ["{count}gg", "{count}"], + "Goto the top of the document
" + "Count is supported, 35gg vertically goes to 35% of the document", function(count) { scrollBufferAbsolute(-1, count > 0 ? count : 0); } ], [ ["G", ""], - "Goto the end of the document", + ["{count}G", "{count}"], + "Goto the end of the document
" + "Count is supported, 35G vertically goes to 35% of the document", function(count) { scrollBufferAbsolute(-1, count >= 0 ? count : 100); } ], [ ["h", ""], - "Scroll document to the left", - "Count is supported: 10h will move 10 times as much to the left.
"+ + ["{count}h", "{count}"], + "Scroll document to the left" + + "Count is supported: 10h will move 10 times as much to the left.
"+ "If the document cannot scroll more, a beep is emmited (unless 'beep' is turned off).", function(count) { scrollBufferRelative(-1, 0); } ], [ ["j", "", ""], - "Scroll document down", - "Count is supported: 10j will move 10 times as much down.
"+ + ["{count}j", "{count}", "{count}"], + "Scroll document down
" + + "Count is supported: 10j will move 10 times as much down.
"+ "If the document cannot scroll more, a beep is emmited (unless 'beep' is turned off).", function(count) { scrollBufferRelative(0, 1); } ], [ ["k", "", ""], - "Scroll document up", - "Count is supported: 10k will move 10 times as much up.
"+ + ["{count}k", "{count}", "{count}"], + "Scroll document up
" + + "Count is supported: 10k will move 10 times as much up.
"+ "If the document cannot scroll more, a beep is emmited (unless 'beep' is turned off).", function(count) { scrollBufferRelative(0, -1); } ], [ ["l", ""], - "Scroll document to the right", - "Count is supported: 10l will move 10 times as much to the right.
"+ + ["{count}l", "{count}"], + "Scroll document to the right
" + + "Count is supported: 10l will move 10 times as much to the right.
"+ "If the document cannot scroll more, a beep is emmited (unless 'beep' is turned off).", function(count) { scrollBufferRelative(1, 0); } ], [ ["", "", ""], - "Scroll up a page", + ["", "", ""], "Scroll up a full page of the current document. No count support for now.", function(count) { goDoCommand('cmd_scrollPageUp'); } ], [ ["", "", ""], - "Scroll down a page", + ["", "", ""], "Scroll down a full page of the current document. No count support for now.", function(count) { goDoCommand('cmd_scrollPageDown'); } ], @@ -639,25 +703,29 @@ var g_mappings = [/*{{{*/ /* history manipulation and jumplist */ [ [""], - "Go to an older position in the jump list", + ["{count}"], + "Go to an older position in the jump list
" + "The jump list is just the browser history for now", function(count) { stepInHistory(count > 0 ? -1 * count : -1); } ], [ [""], - "Go to a newer position in the jump list", + ["{count}"], + "Go to a newer position in the jump list
" + "The jump list is just the browser history for now", function(count) { stepInHistory(count > 0 ? count : 1); } ], [ ["H", "", ""], - "Go back in the browser history", + ["{count}H", "{count}", "{count}"], + "Go back in the browser history
" + "Count is supported, 3H goes back 3 steps.", function(count) { stepInHistory(count > 0 ? -1 * count : -1); } ], [ ["L", "", ""], - "Go forward in the browser history", + ["{count}L", "{count}", "{count}"], + "Go forward in the browser history
" + "Count is supported, 3L goes forward 3 steps.", function(count) { stepInHistory(count > 0 ? count : 1); } ], @@ -665,28 +733,31 @@ var g_mappings = [/*{{{*/ /* hint managment */ [ ["f"], - "Start QuickHint mode", - "In QuickHint mode, every hintable item (according to the 'hinttags' XPath query) is assigned a label.
"+ - "If you then press the keys for a label, it is followed as soon as it can be uniquely identified and this mode is stopped. Or press <Esc> to stop this mode.
"+ + ["f"], + "Start QuickHint mode
" + + "In QuickHint mode, every hintable item (according to the 'hinttags' XPath query) is assigned a label.
"+ + "If you then press the keys for a label, it is followed as soon as it can be uniquely identified and this mode is stopped. Or press <Esc> to stop this mode.
"+ "If you write the hint in ALLCAPS, the hint is followed in a background tab.", function(count) { hah.enableHahMode(HINT_MODE_QUICK); } ], [ ["F"], - "Start AlwaysHint mode", - "In AlwaysHint mode, every hintable item (according to the 'hinttags' XPath query) is assigned a label.
"+ - "If you then press the keys for a label, it is followed as soon as it can be uniquely identified. Labels stay active after following a hint in this mode, press <Esc> to stop this mode.
"+ - "This hint mode is especially useful for browsing large sites like Forums as hints are automatically regenerated when switching to a new document.
"+ + ["F"], + "Start AlwaysHint mode
" + + "In AlwaysHint mode, every hintable item (according to the 'hinttags' XPath query) is assigned a label.
"+ + "If you then press the keys for a label, it is followed as soon as it can be uniquely identified. Labels stay active after following a hint in this mode, press <Esc> to stop this mode.
"+ + "This hint mode is especially useful for browsing large sites like Forums as hints are automatically regenerated when switching to a new document.
"+ "Also, most Ctrl-prefixed shortcut keys are available in this mode for navigation.", function(count) { hah.enableHahMode(HINT_MODE_ALWAYS); } ], [ [";"], - "Start ExtendedHint mode", - "ExtendedHint mode is useful, since in this mode you can yank link locations, or open them in a new window.
"+ - "If you want to yank the location of hint AB, press ; to start this hint mode.
"+ - "Then press AB to select the hint. Now press y to yank its location.
"+ - "Actions for selected hints in ExtendedHint mode are:
"+ + [";"], + "Start ExtendedHint mode
" + + "ExtendedHint mode is useful, since in this mode you can yank link locations, or open them in a new window.
"+ + "If you want to yank the location of hint AB, press ; to start this hint mode.
"+ + "Then press AB to select the hint. Now press y to yank its location.
"+ + "Actions for selected hints in ExtendedHint mode are:
"+ "
  • y to yank its location
  • "+ "
  • o to open its location in the current tab
  • "+ "
  • t to open its location in a new tab
  • "+ @@ -695,7 +766,7 @@ var g_mappings = [/*{{{*/ "
  • s to save its destination (not implemented yet)
  • "+ "
  • <C-w> to open its destination in a new window
  • "+ "
"+ - "Multiple hints can be seperated by commas where it makes sense. ;AB,AC,ADt opens AB, AC and AD in a new tab.
"+ + "Multiple hints can be seperated by commas where it makes sense. ;AB,AC,ADt opens AB, AC and AD in a new tab.
"+ "Hintable elements for this mode can be set in the 'extendedhinttags' XPath string.", function(count) { hah.enableHahMode(HINT_MODE_EXTENDED); } ], @@ -703,14 +774,16 @@ var g_mappings = [/*{{{*/ /* search managment */ [ ["n"], - "Find next", + ["n"], + "Find next
" + "Repeat the last \"/\" 1 time (until count is supported).", // don't use a closure for this, is just DoesNotWork (TM) function(count) { gFindBar.onFindAgainCmd(); } // this does not work, why?: goDoCommand('cmd_findAgain'); } ], [ ["N"], - "Find previous", + ["N"], + "Find previous
" + "Repeat the last \"/\" 1 time (until count is supported) in the opposite direction.", // don't use a closure for this, is just DoesNotWork (TM) function(count) { gFindBar.onFindPreviousCmd(); } // this does not work, why?: goDoCommand('cmd_findPrevious'); } @@ -719,100 +792,105 @@ var g_mappings = [/*{{{*/ /* vimperator managment */ [ [""], - "Open help window", + [""], + "Open help window
" + "The default section is shown, if you need help for a specific topic, try :help <F1> (jumping to a specific section not implemented yet).", function(count) { help(null); } ], [ [":"], - "Start command line mode", + [":"], + "Start command line mode
" + "In command line mode, you can perform extended commands, which may require arguments.", function(count) { openVimperatorBar(null); } ], [ ["I"], - "Disable vimperator keys", - "Starts an 'ignorekeys' mode, where all keys except <Esc> are passed to the next event handler.
"+ - "This is especially useful, if JavaScript controlled forms like the RichEdit form fields of GMail don't work anymore.
" + + ["I"], + "Disable vimperator keys
" + + "Starts an 'ignorekeys' mode, where all keys except <Esc> are passed to the next event handler.
"+ + "This is especially useful, if JavaScript controlled forms like the RichEdit form fields of GMail don't work anymore.
" + "To exit this mode, press <Esc>. If you also need to pass <Esc>"+ "in this mode to the webpage, prepend it with <C-v>.", function(count) { addMode(MODE_ESCAPE_ALL_KEYS);} ], [ [""], // if you ever add/remove keys here, also check them in the onVimperatorKeypress() function - "Escape next key", - "If you need to pass a certain key to a javascript form field or another extension prefix the key with <C-v>.
"+ - "Also works to unshadow Firefox shortcuts like <C-o> which are otherwise hidden in Vimperator.
"+ + [""], + "Escape next key
" + + "If you need to pass a certain key to a javascript form field or another extension prefix the key with <C-v>.
"+ + "Also works to unshadow Firefox shortcuts like <C-o> which are otherwise hidden in Vimperator.
"+ "When in 'ignorekeys' mode (activated by <I>), <C-v> will pass the next key to Vimperator instead of the webpage.", function(count) { addMode(MODE_ESCAPE_ONE_KEY); } ], [ ["", ""], // if you ever add/remove keys here, also check them in the onVimperatorKeypress() function - "Cancel any operation", - "Stops loading the current webpage and exits any command line or hint mode.
"+ + ["", ""], + "Cancel any operation
" + + "Stops loading the current webpage and exits any command line or hint mode.
"+ "Also focuses the web page, in case a form field has focus, and eats our key presses.", onEscape ], /* quick bookmark access - will be customizable in future*/ [ + ["'b"], ["'b"], "These quick bookmarks will be customizable in future releases, ignore for now", - null, function(count) { openURLs('www.bwin.com'); } ], [ + ["'o"], ["'o"], "These quick bookmarks will be customizable in future releases, ignore for now", - null, function(count) { openURLs('www.osnews.com'); } ], [ ["'s"], - "These quick bookmarks will be customizable in future releases, ignore for now", - null, + ["'s"], + "These quick bookmarks will be customizable in future releases, ignore for now
", function(count) { openURLs('www.derstandard.at'); } ], [ ["'w"], - "These quick bookmarks will be customizable in future releases, ignore for now", - null, + ["'w"], + "These quick bookmarks will be customizable in future releases, ignore for now
", function(count) { openURLs('wetter.orf.at'); } ], [ ["'t"], - "These quick bookmarks will be customizable in future releases, ignore for now", - null, + ["'t"], + "These quick bookmarks will be customizable in future releases, ignore for now
", function(count) { openURLs('www.tvinfo.de'); } ], [ ["\"b"], - "These quick bookmarks will be customizable in future releases, ignore for now", - null, + ["\"b"], + "These quick bookmarks will be customizable in future releases, ignore for now
", function(count) { openURLsInNewTab('www.bwin.com'); } ], [ ["\"o"], - "These quick bookmarks will be customizable in future releases, ignore for now", - null, + ["\"o"], + "These quick bookmarks will be customizable in future releases, ignore for now
", function(count) { openURLsInNewTab('www.osnews.com'); } ], [ ["\"s"], - "These quick bookmarks will be customizable in future releases, ignore for now", - null, + ["\"s"], + "These quick bookmarks will be customizable in future releases, ignore for now
", function(count) { openURLsInNewTab('www.derstandard.at'); } ], [ ["\"w"], - "These quick bookmarks will be customizable in future releases, ignore for now", - null, + ["\"w"], + "These quick bookmarks will be customizable in future releases, ignore for now
", function(count) { openURLsInNewTab('wetter.orf.at'); } ], [ ["\"t"], - "These quick bookmarks will be customizable in future releases, ignore for now", - null, + ["\"t"], + "These quick bookmarks will be customizable in future releases, ignore for now
", function(count) { openURLsInNewTab('www.tvinfo.de'); } ] ];/*}}}*/ @@ -918,25 +996,26 @@ function get_command(cmd) // {{{ return null; } // }}} -function execute_command(count, cmd, special, args) // {{{ +function execute_command(count, cmd, special, args, modifiers) // {{{ { if (!cmd) return; + if (!modifiers) modifiers = {}; var command = get_command(cmd); - if (command == null) + if (command === null) { echoerr("E492: Not an editor command: " + cmd); focusContent(false, false); return; } - if (command[3] == null) + if (command[3] === null) { - echoerr("E666: Internal error: command[3] == null"); + echoerr("E666: Internal error: command[3] === null"); return; } // valid command, call it: - command[3].call(this, args, special, count); + command[3].call(this, args, special, count, modifiers); } // }}} @@ -991,6 +1070,7 @@ function multiliner(line, prev_match, heredoc) if (match[4] === false) { prev_match[3] = prev_match[3].replace(new RegExp('<<\s*' + prev_match[4]), heredoc.replace(/\n$/, '')); + focusContent(false, true); // also sets comp_tab_index to -1 execute_command.apply(this, prev_match); prev_match = new Array(5); prev_match[3] = ''; @@ -1018,7 +1098,10 @@ function multiliner(line, prev_match, heredoc) function execute(string) { - return execute_command.apply(this, tokenize_ex(string.replace(/^'(.*)'$/, '$1'))); + if (!string) return; + var tokens = tokenize_ex(string.replace(/^'(.*)'$/, '$1')); + tokens[4] = arguments[3]; + return execute_command.apply(this, tokens); } //////////////////////////////////////////////////////////////////////// // statusbar/commandbar handling ////////////////////////////////// {{{1 @@ -1339,6 +1422,11 @@ function show_location_marks(mark) //////////////////////////////////////////////////////////////////////// // tab/buffer related functions /////////////////////////////////// {{{1 //////////////////////////////////////////////////////////////////////// +function tab() +{ + execute(arguments[0], null, null, {inTab: true}); +} + /* if index = 0, advance on tab * if index < 0, go one tab to the left * otherwise, jump directly to tab @@ -1511,7 +1599,8 @@ function zoom_in(factor) function zoom_to(value) { var zoomMgr = ZoomManager.prototype.getInstance(); - if (!value || value <= 0) + value = parseInt(value); + if (!value || isNaN(value) || value <= 0) value = 100; // convert to int, if string was given @@ -1740,6 +1829,8 @@ function help(section, easter) echoerr("E478: Don't panic!"); return; } + if (arguments[3].inTab) + openURLsInNewTab("", true); var doc = window.content.document; @@ -1765,6 +1856,23 @@ table.vimperator td {\ border-color: gray gray gray gray;\ background-color: rgb(250, 240, 230);\ }\ +tr.tag {\ + text-align: right;\ +}\ +tr.tag td {\ + width: 100%;\ +}\ +tr.tag code, td.usage code {\ + margin: 0px 2px;\ +}\ +tr.tag code {\ + font-weight: bold;\ + font-size: 1opx;\ + margin-left: 2em;\ +}\ +tr.desciption {\ + margin-bottom: 4px;\ +}\ table.commands td {\ background-color: rgb(250, 240, 230);\ }\ @@ -1828,27 +1936,30 @@ table.settings th {\ var ret = ""; for (var i=0; i < commands.length; i++) { - ret += ''; - var command = ""; + ret += ''; for (var j=0; j < commands[i][0].length; j++) { var cmd_name = commands[i][0][j]; cmd_name = cmd_name.replace(//g, ">"); - if (j==0) // color the first item differently - command += "" +beg+ cmd_name +end+ '
'; - else - command += "" +beg+ cmd_name +end+ '
'; + ret += "" +beg+ cmd_name +end+ ''; } - ret += command + ''; - if (commands[i][1]) - ret += '' + commands[i][1] + '
'; // the short description + ret += ''; + for (var j=0; j < commands[i][1].length; j++) + { + var usage = commands[i][1][j]; + + usage = usage.replace(/<(?!br\/>)/g, "<"); + usage = usage.replace(/[^b][^r][^\/]>/g, ">"); + ret += "" +beg+ usage +end+ '
'; + } + ret += ''; if (func) ret += func.call(this, commands[i]); if (commands[i][2]) { if(func) - ret += "
" + ret += "
" ret += commands[i][2]; // the help description } ret += ''; @@ -1867,9 +1978,14 @@ table.settings th {\ ret += "off"; } else - ret += command[6]; + { + if (typeof command[6] == 'string' && command[6].length == 0) + ret += "''"; + else + ret += command[6]; + } - ret += ")"; + ret += ")
"; return ret; } diff --git a/chrome/content/vimperator/settings.js b/chrome/content/vimperator/settings.js index 62e69043..ace2233d 100644 --- a/chrome/content/vimperator/settings.js +++ b/chrome/content/vimperator/settings.js @@ -15,7 +15,7 @@ var opt_fullscreen = false; * format: * [ * 0: [all names of this setting], - * 1: description, + * 1: usage, * 2: help text, * 3: set_function, * 4: get_function, @@ -28,7 +28,8 @@ var opt_fullscreen = false; var g_settings = [/*{{{*/ [ ["activate"], - "Define when tabs are automatically activated", + ["activate"], + "Define when tabs are automatically activated
" + "Not implemented yet", function(value) { set_pref("activate", value); }, function() { return get_pref("activate"); }, @@ -38,9 +39,9 @@ var g_settings = [/*{{{*/ null ], [ + ["beep"], ["beep"], "Emit a pc speaker beep on certain errors", - null, function(value) { set_pref("beep", value); }, function() { return get_pref("beep"); }, "boolean", @@ -50,7 +51,8 @@ var g_settings = [/*{{{*/ ], [ ["complete", "cpt"], - "Order and items which are completed at the :[tab]open prompt", + ["complete", "cpt"], + "Order and items which are completed at the :[tab]open prompt
" + "Available items:
"+ "
  • s: Search machines
  • "+ " b: Bookmarks
  • "+ @@ -65,8 +67,8 @@ var g_settings = [/*{{{*/ ], [ ["extendedhinttags", "eht"], - "XPath string of hintable elements activated by ';'", - null, + ["extendedhinttags", "eht"], + "XPath string of hintable elements activated by ';'
    ", function(value) { set_pref("extendedhinttags", value); }, function() { return get_pref("extendedhinttags"); }, "string", @@ -75,9 +77,9 @@ var g_settings = [/*{{{*/ null ], [ + ["focusedhintstyle", "fhs"], ["focusedhintstyle", "fhs"], "CSS specification of focused hints appearance", - null, function(value) { set_pref("focusedhintstyle", value); }, function() { return get_pref("focusedhintstyle"); }, "string", @@ -86,9 +88,9 @@ var g_settings = [/*{{{*/ null ], [ + ["fullscreen", "fs"], ["fullscreen", "fs"], "Shows the current window fullscreen", - null, function(value) { opt_fullscreen = value; BrowserFullScreen(); }, function() { return opt_fullscreen; }, "boolean", @@ -98,7 +100,8 @@ var g_settings = [/*{{{*/ ], [ ["guioptions", "go"], - "Shows or hides the menu, toolbar and scrollbars", + ["guioptions", "go"], + "Shows or hides the menu, toolbar and scrollbars
    " + "Supported characters:
    • m: menubar
    • T: toolbar
    • b: bookmark bar
    • s: original Firefox statusbar
    ", function(value) { set_pref("guioptions", value); set_guioptions(value); }, function() { return get_pref("guioptions"); }, @@ -108,9 +111,9 @@ var g_settings = [/*{{{*/ null ], [ + ["hintchars", "hc"], ["hintchars", "hc"], "String of single characters which can be used to follow hints", - null, function(value) { set_pref("hintchars", value); }, function() { return get_pref("hintchars"); }, "charlist", @@ -119,9 +122,9 @@ var g_settings = [/*{{{*/ null ], [ + ["hintstyle", "hs"], ["hintstyle", "hs"], "CSS specification of unfocused hints appearance", - null, function(value) { set_pref("hintstyle", value); }, function() { return get_pref("hintstyle"); }, "string", @@ -130,9 +133,9 @@ var g_settings = [/*{{{*/ null ], [ + ["hinttags"], ["hinttags"], "XPath string of hintable elements activated by 'f'", - null, function(value) { set_pref("hinttags", value); }, function() { return get_pref("hinttags"); }, "string", @@ -142,7 +145,8 @@ var g_settings = [/*{{{*/ ], [ ["maxhints", "mh"], - "Maximum of simultanously shown hints", + ["maxhints", "mh"], + "Maximum of simultanously shown hints
    " + "If you want to speed up display of hints, choose a smaller value", function(value) { set_pref("maxhints", value); }, function() { return get_pref("maxhints"); }, @@ -153,7 +157,8 @@ var g_settings = [/*{{{*/ ], [ ["preload"], - "Speed up first time history/bookmark completion", + ["preload"], + "Speed up first time history/bookmark completion
    " + "History access can be quite slow for a large history. Vimperator maintains a cache to speed it up significantly on subsequent access.
    "+ "In order to also speed up first time access, it is cached at startup, if this option is set (recommended).", function(value) { set_pref("preload", value); }, @@ -165,7 +170,8 @@ var g_settings = [/*{{{*/ ], [ ["previewheight", "pvh"], - "Default height for preview window", + ["previewheight", "pvh"], + "Default height for preview window
    " + "Value must be between 1 and 50. If the value is too high, completions may cover the command-line. Close the preview window with :pclose.", function(value) { set_pref("previewheight", value); }, function() { return get_pref("previewheight"); }, @@ -175,9 +181,9 @@ var g_settings = [/*{{{*/ null ], [ + ["showmode", "smd"], ["showmode", "smd"], "Show the current mode in the command line", - null, function(value) { set_pref("showmode", value); }, function() { return get_pref("showmode"); }, "boolean", @@ -187,7 +193,8 @@ var g_settings = [/*{{{*/ ], [ ["showtabline", "stal"], - "Control when to show the tab bar of opened web pages", + ["showtabline", "stal"], + "Control when to show the tab bar of opened web pages
    " + "Available items:
    "+ "
    • 0: Never show tab bar
    • "+ " 1: Show tab bar only if more than one tab is open
    • "+ @@ -202,7 +209,8 @@ var g_settings = [/*{{{*/ ], [ ["usermode", "um"], - "Show current website with a minimal stylesheet to make it easily accessible", + ["usermode", "um"], + "Show current website with a minimal stylesheet to make it easily accessible
      " + "Note that this is a local setting for now, later it may be split into a global and :setlocal part", function(value) { opt_usermode = value; setStyleDisabled(value); }, function() { return opt_usermode; }, @@ -213,12 +221,13 @@ var g_settings = [/*{{{*/ ], [ ["wildmode", "wim"], - "Define how command line completion works", + ["wildmode", "wim"], + "Define how command line completion works
      " + "Not implemented yet.", function(value) { set_pref("wildmode", value); }, function() { return get_pref("wildmode"); }, "stringlist", - "menu", + "full", null, null ] diff --git a/chrome/content/vimperator/vimperator.js b/chrome/content/vimperator/vimperator.js index fb545868..89348b98 100644 --- a/chrome/content/vimperator/vimperator.js +++ b/chrome/content/vimperator/vimperator.js @@ -537,7 +537,13 @@ function onCommandBarKeypress(evt)/*{{{*/ // unfocus command line first add_to_command_history(command); - [prev_match, heredoc, end] = multiliner(command, prev_match, heredoc); + try { + [prev_match, heredoc, end] = multiliner(command, prev_match, heredoc); + } catch(e) { + echoerr(e.name + ": " + e.message); + prev_match = new Array(5); + heredoc = ''; + } if (!end) command_line.value = ""; } diff --git a/install.rdf b/install.rdf index e4ec614d..e36fb970 100644 --- a/install.rdf +++ b/install.rdf @@ -2,26 +2,26 @@ - - {f9570b26-e246-4753-9b68-61aa95994237} - Vimperator - 0.3 - Make Firefox work like Vim - Martin Stubenschrott - http://vimperator.mozdev.org - http://downloads.mozdev.org/vimperator/update.rdf - - - content/vimperator/ - - + + vimperator@mozdev.org + Vimperator + 0.3 + Make Firefox work like Vim + Martin Stubenschrott + http://vimperator.mozdev.org + http://downloads.mozdev.org/vimperator/update.rdf + + + content/vimperator/ + + - - - {ec8030f7-c20a-464f-9b0e-13a3a9e97384} - 2.0 - 3.0 - - - + + + {ec8030f7-c20a-464f-9b0e-13a3a9e97384} + 2.0 + 3.0 + + +