1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-02-17 22:05:46 +01:00

Hack on :help NEWS.

This commit is contained in:
Kris Maglione
2011-02-19 07:17:54 -05:00
parent 73917f7cee
commit 2cef435dbc
3 changed files with 103 additions and 76 deletions

View File

@@ -687,19 +687,21 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
.responseText; .responseText;
let re = util.regexp(<![CDATA[ let re = util.regexp(<![CDATA[
^ (?P<space> \s*) ^ (?P<comment> \s* # .*\n)
(?P<char> [-*+]) \ //
(?P<content> .*\n | ^ (?P<space> \s*)
(?: \1\ \ .*\n | \s*\n)* ) (?P<char> [-*+]) \ //
| (?P<content> .*\n
(?P<par> (?: \2\ \ .*\n | \s*\n)* )
(?: ^ [^\S\n]*
(?:[^-*+\s] | [-*+]\S) | (?P<par>
.*\n (?: ^ [^\S\n]*
)+ (?:[^-*+\s] | [-*+]\S)
) .*\n
| )+
(?: ^ [^\S\n]* \n) + )
| (?: ^ [^\S\n]* \n) +
]]>, "gmxy"); ]]>, "gmxy");
let betas = util.regexp(/\[(b\d)\]/, "gx"); let betas = util.regexp(/\[(b\d)\]/, "gx");
@@ -713,7 +715,9 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
let list, space, i = 0; let list, space, i = 0;
for (let match in re.iterate(text)) { for (let match in re.iterate(text)) {
if (match.char) { if (match.comment)
continue;
else if (match.char) {
if (!list) if (!list)
res += list = <ul/>; res += list = <ul/>;
let li = <li/>; let li = <li/>;
@@ -759,7 +763,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
let body = rec(NEWS, 0); let body = rec(NEWS, 0);
for each (let li in body..li) { for each (let li in body..li) {
let list = li..li.(@NS::highlight == "HelpNewsOld"); let list = li..li.(@NS::highlight == "HelpNewsOld");
if (list.length() && list.length() == li..li.length()) { if (list.length() && list.length() == li..li.(@NS::highlight != "").length()) {
for each (let li in list) for each (let li in list)
li.@NS::highlight = ""; li.@NS::highlight = "";
li.@NS::highlight = "HelpNewsOld"; li.@NS::highlight = "HelpNewsOld";

View File

@@ -196,28 +196,44 @@ var Template = Module("Template", {
// </e4x> // </e4x>
}, },
helpLink: function (topic, text, type) { helpLink: function (token, text, type) {
if (!services["dactyl:"].initialized) if (!services["dactyl:"].initialized)
util.dactyl.initHelp(); util.dactyl.initHelp();
let topic = token; // FIXME: Evil duplication!
if (/^\[.*\]$/.test(topic))
topic = topic.slice(1, -1);
else if (/^n_/.test(topic))
topic = topic.slice(2);
if (services["dactyl:"].initialized && !set.has(services["dactyl:"].HELP_TAGS, topic)) if (services["dactyl:"].initialized && !set.has(services["dactyl:"].HELP_TAGS, topic))
return <span highlight={type || ""}>{text || topic}</span>; return <span highlight={type || ""}>{text || token}</span>;
XML.ignoreWhitespace = false; XML.prettyPrinting = false; XML.ignoreWhitespace = false; XML.prettyPrinting = false;
type = type || (/^'.*'$/.test(topic) ? "HelpOpt" : type = type || (/^'.*'$/.test(token) ? "HelpOpt" :
/^:\w/.test(topic) ? "HelpEx" : "HelpKey"); /^\[.*\]$/.test(token) ? "HelpTopic" :
/^:\w/.test(token) ? "HelpEx" : "HelpKey");
return <a highlight={type} tag={topic} href={"dactyl://help-tag/" + topic} dactyl:command="dactyl.help" xmlns:dactyl={NS}>{text || topic}</a>; return <a highlight={type} tag={topic} href={"dactyl://help-tag/" + topic} dactyl:command="dactyl.help" xmlns:dactyl={NS}>{text || topic}</a>;
}, },
HelpLink: function (topic) { HelpLink: function (token) {
if (!services["dactyl:"].initialized) if (!services["dactyl:"].initialized)
util.dactyl.initHelp(); util.dactyl.initHelp();
let topic = token; // FIXME: Evil duplication!
if (/^\[.*\]$/.test(topic))
topic = topic.slice(1, -1);
else if (/^n_/.test(topic))
topic = topic.slice(2);
if (services["dactyl:"].initialized && !set.has(services["dactyl:"].HELP_TAGS, topic)) if (services["dactyl:"].initialized && !set.has(services["dactyl:"].HELP_TAGS, topic))
return <>{topic}</>; return <>{token}</>;
XML.ignoreWhitespace = false; XML.prettyPrinting = false; XML.ignoreWhitespace = false; XML.prettyPrinting = false;
let tag = (/^'.*'$/.test(topic) ? "o" : let tag = (/^'.*'$/.test(token) ? "o" :
/^:\w/.test(topic) ? "ex" : "k"); /^\[.*\]$/.test(token) ? "t" :
/^:\w/.test(token) ? "ex" : "k");
topic = topic.replace(/^'(.*)'$/, "$1"); topic = topic.replace(/^'(.*)'$/, "$1");
return <{tag} xmlns={NS}>{topic}</{tag}>; return <{tag} xmlns={NS}>{topic}</{tag}>;
}, },
@@ -347,7 +363,7 @@ var Template = Module("Template", {
linkifyHelp: function linkifyHelp(str, help) { linkifyHelp: function linkifyHelp(str, help) {
let re = util.regexp(<![CDATA[ let re = util.regexp(<![CDATA[
(?P<pre> [/\s]|^) (?P<pre> [/\s]|^)
(?P<tag> '[\w-]+' | :(?:[\w-]+|!) | (?:._)?<[\w-]+> ) (?P<tag> '[\w-]+' | :(?:[\w-]+!?|!) | (?:._)?<[\w-]+>\w* | [a-zA-Z]_\w+ | \[[\w-]+\] )
(?= [[\)!,;./\s]|$) (?= [[\)!,;./\s]|$)
]]>, "gx"); ]]>, "gx");
return this.highlightSubstrings(str, (function () { return this.highlightSubstrings(str, (function () {

View File

@@ -1,15 +1,18 @@
1.0b6pre: 1.0b6pre:
* Extensive Firefox 4 support, including: Extensive Firefox 4 support, including:
- Fully restartless. Can now be installed, uninstalled, - Fully restartless. Can now be installed, uninstalled,
enabled, disabled, and upgraded without restarting Firefox. enabled, disabled, and upgraded without restarting Firefox.
[b4] [b4]
- Tabs in :buffer completions and listings are grouped - Tabs in :buffer completions and listings are grouped
by panorama groups. [b1] by panorama groups. [b1]
- Only visible tabs are considered in tab numbering, - Only visible tabs are considered in tab numbering,
gt/gn/gN, etc. [b1] n_gt, n_gn, etc. [b1]
* Improved startup time by a factor of 7. [b1] • Performance improvements:
* Further improved startup time. [b6] - Improved startup time by a factor of 7. [b1]
* Added site-local and script-local groups: [b6] - Further improved startup time. [b6]
- Significant completion speed improvements, especially for
JavaScript. [b1]
• Added site-local and script-local groups: [b6]
- Added the :group command to define and select groups. - Added the :group command to define and select groups.
- Added the -group flag to :abbreviate, :autocmd, :command, - Added the -group flag to :abbreviate, :autocmd, :command,
:map, :style, and friends. :map, :style, and friends.
@@ -18,9 +21,7 @@
- Autocommands, commands, mappings, and styles are now - Autocommands, commands, mappings, and styles are now
automatically added to per-script groups so that most traces automatically added to per-script groups so that most traces
of a script can be easily purged. of a script can be easily purged.
* Significant completion speed improvements, especially for • Greatly improved private mode support and :sanitize command.
JavaScript. [b1]
* Greatly improved private mode support and :sanitize command.
- Full integration with Firefox data clearing dialogs. [b3] - Full integration with Firefox data clearing dialogs. [b3]
- Support for sanitizing items at shutdown. [b3] - Support for sanitizing items at shutdown. [b3]
- Fine-grained control over what data is sanitized and for - Fine-grained control over what data is sanitized and for
@@ -28,7 +29,7 @@
- Support for sanitizing reference to particular hosts, - Support for sanitizing reference to particular hosts,
everywhere from command-line and message history to option everywhere from command-line and message history to option
values and cookies. [b1] values and cookies. [b1]
* New and much more powerful incremental search implementation. New and much more powerful incremental search implementation.
Improvements over the standard Firefox find include: [b1] Improvements over the standard Firefox find include: [b1]
- Starts at the cursor position in the currently selected - Starts at the cursor position in the currently selected
frame, unlike Firefox, which always starts at the start of frame, unlike Firefox, which always starts at the start of
@@ -39,15 +40,15 @@
backspace. backspace.
- Supports reverse incremental search. - Supports reverse incremental search.
- Input boxes are not focused when matches are highlighted. - Input boxes are not focused when matches are highlighted.
* Ex command parsing improvements, including: Ex command parsing improvements, including:
- Multiple Ex commands may now be separated by | [b1] - Multiple Ex commands may now be separated by | [b1]
- Commands can continue over multiple lines in RC files by - Commands can continue over multiple lines in RC files by
prefixing the continuation lines with a \ [b3] prefixing the continuation lines with a \ [b3]
- The \ character is no longer treated specially within single - The \ character is no longer treated specially within single
quotes, i.e., 'fo\o''bar' ⇒ fo\o'bar [b1] quotes, i.e., 'fo\o''bar' ⇒ fo\o'bar [b1]
* Command line is now hidden by default. Added c, C, and M to • The command line is now hidden by default. Added c, C, and M to
'guioptions'. [b4] 'guioptions'. [b4]
* Hint mode improvements, including: Hint mode improvements, including:
- Added g; continued extended hint mode, which allows - Added g; continued extended hint mode, which allows
selecting multiple hints. Removed ;F. [b1] selecting multiple hints. Removed ;F. [b1]
- Hints are now updated after scrolling and window resizing. [b3] - Hints are now updated after scrolling and window resizing. [b3]
@@ -56,18 +57,19 @@
- Added ;a and ;S modes for creating bookmarks and search keywords. [b4][b3] - Added ;a and ;S modes for creating bookmarks and search keywords. [b4][b3]
- Added 'hintkeys' option. [b2] - Added 'hintkeys' option. [b2]
- Added "transliterated" option to 'hintmatching'. [b1] - Added "transliterated" option to 'hintmatching'. [b1]
* JavaScript completion improvements, including: [b2] • General completion improvements
- The prototype of the function whose arguments are currently - JavaScript completion improvements, including: [b2]
being typed is displayed during completion. + The prototype of the function whose arguments are currently
- Non-enumerable global properties are now completed for the being typed is displayed during completion.
global object, including XMLHttpRequest and encodeURI. + Non-enumerable global properties are now completed for the
* The concept of completion contexts is now exposed to the user global object, including XMLHttpRequest and encodeURI.
(see :h :contexts), allowing for powerful and fine-grained - The concept of completion contexts is now exposed to the user
completion system customization. [b1] (see :contexts), allowing for powerful and fine-grained
* The external editor can now be configured to open to a given completion system customization. [b1]
• The external editor can now be configured to open to a given
line number and column, used for opening source links and line number and column, used for opening source links and
editing input fields with i_<C-i>. See :h 'editor'. [b4] editing input fields with i_<C-i>. See :h 'editor'. [b4]
* Mapping changes: Mapping changes:
- It's now possible to map keys in many more modes, including - It's now possible to map keys in many more modes, including
Hint, Multi-line Output, and Menu. [b4] Hint, Multi-line Output, and Menu. [b4]
- Added site-specific mapping groups and related command - Added site-specific mapping groups and related command
@@ -78,17 +80,17 @@
- Removed the implicit page load delays during macro playback. [b6] - Removed the implicit page load delays during macro playback. [b6]
- Added the base modes Base, Main, and Command which other - Added the base modes Base, Main, and Command which other
modes inherit key bindings from. [b6] modes inherit key bindings from. [b6]
* Command changes: Command changes:
- :viusage, :optionusage and :exusage were replaced with :listkeys, - :viusage, :optionusage and :exusage were replaced with :listkeys,
:listoptions and :listcommands, providing more powerful and :listoptions and :listcommands, providing more powerful and
consistent interactive help facility (improvements include consistent interactive help facility (improvements include
listing keys for modes other than Normal, filtering the output listing keys for modes other than Normal, filtering the output,
and linking to source code locations). [b4] and linking to source code locations). [b4]
- :downloads now opens a download list in the multi-line output - :downloads now opens a download list in the multi-line output
buffer. [b6] buffer. [b6]
- :extensions has been replaced with a more powerful :addons. [b6]
- :javascript! now opens a Read Eval Print Loop. [b6] - :javascript! now opens a Read Eval Print Loop. [b6]
- Added -arg flag to :map. [b6] - Added -arg flag to :map. [b6]
- :extensions has been replaced with a more powerful :addons. [b6]
- Added -literal flag to :command. [b6] - Added -literal flag to :command. [b6]
- Added :completions command. [b6] - Added :completions command. [b6]
- Added :cookies command. [b3] - Added :cookies command. [b3]
@@ -117,7 +119,7 @@
- :command now accepts comma-separated alternative command names. [b4] - :command now accepts comma-separated alternative command names. [b4]
- :command -complete custom now also accepts a completions array, see - :command -complete custom now also accepts a completions array, see
:h :command-completion-custom. [b4] :h :command-completion-custom. [b4]
* Improvements to :style and :highlight: Improvements to :style and :highlight:
- Added -link flag to :highlight. [b4] - Added -link flag to :highlight. [b4]
- Added -agent flag to :style. [b2] - Added -agent flag to :style. [b2]
- The -append flag now updates existing properties rather than - The -append flag now updates existing properties rather than
@@ -128,22 +130,23 @@
- CSS property name completion is now available. [b4] - CSS property name completion is now available. [b4]
- :delstyle, :styleenable, :styledisable and :styletoggle accept a ! - :delstyle, :styleenable, :styledisable and :styletoggle accept a !
to operate on all styles. [b6] to operate on all styles. [b6]
* IMPORTANT option changes: IMPORTANT option changes:
- 'hinttags' and 'extendedhinttags' now treat their values as
CSS selectors by default. [b6]
- 'showmode' is now a regexplist. [b6]
- Option value quoting has changed. List options will - Option value quoting has changed. List options will
no longer be split at quoted commas and the option name, operators, and no longer be split at quoted commas and the option name,
= sign may no longer be quoted. This will break certain operators, and = sign may no longer be quoted. This will
automatically-generated configuration files. See :help stringlist. [b2] break certain automatically-generated configuration files.
See :help
[stringlist]. [b2]
- Boolean options no longer accept an argument. [b4] - Boolean options no longer accept an argument. [b4]
- 'cdpath' and 'runtimepath' no longer treat ",," - 'cdpath' and 'runtimepath' no longer treat ",,"
specially. Use "." instead. [b2] specially. Use "." instead. [b2]
- 'incsearch', 'hlsearch', 'ignorecase', and 'smartcase' have - 'extendedhinttags' is now a [regexpmap] rather than a
been replaced with 'incfind', 'hlfind', and 'findcase'. [b4]
- 'extendedhinttags' is now a regexpmap rather than a
string. [b2] string. [b2]
- 'guioptions' default value has changed. [b4] - 'guioptions' default value has changed. [b4]
- 'hinttags' and 'extendedhinttags' now treat their values as
CSS selectors by default. [b6]
- 'incsearch', 'hlsearch', 'ignorecase', and 'smartcase' have
been replaced with 'incfind', 'hlfind', and 'findcase'. [b4]
- 'laststatus' has been replaced with the "s" flag in - 'laststatus' has been replaced with the "s" flag in
'guioptions'. [b4] 'guioptions'. [b4]
- 'linksearch' has been removed. The \l search modifier can - 'linksearch' has been removed. The \l search modifier can
@@ -152,14 +155,16 @@
a boolean. [b2] a boolean. [b2]
- 'mapleader' is now an option rather than a :let - 'mapleader' is now an option rather than a :let
variable. [b4] variable. [b4]
- 'showstatuslinks' and 'showtabline' are now string options. [b4]
- 'passkeys' is now a sitemap rather than a regexpmap. [b6] - 'passkeys' is now a sitemap rather than a regexpmap. [b6]
* IMPORTANT: Command script files now use the *.penta file extension. [b2] - 'showmode' is now a regexplist. [b6]
* IMPORTANT: Plugins are now loaded from the 'plugins/' - 'showstatuslinks' and 'showtabline' are now string options. [b4]
• IMPORTANT: Command script files now use the *.penta file extension. [b2]
• IMPORTANT: Plugins are now loaded from the 'plugins/'
directory in 'runtimepath' rather than 'plugin/'. [b1] directory in 'runtimepath' rather than 'plugin/'. [b1]
* Option changes: Option changes:
- Added stringmap, regexplist and regexpmap option types. [b1] - Added [stringmap], [regexplist], and [regexpmap] option
- Added sitelist and sitemap option types. [b6] types. [b1]
- Added [sitelist] and [sitemap] option types. [b6]
- Added "bookmarks", "diverted", and "links" to 'activate' - Added "bookmarks", "diverted", and "links" to 'activate'
option. [b2] option. [b2]
- Added 'altwildmode' and c_<A-Tab> command-line key binding. [b2] - Added 'altwildmode' and c_<A-Tab> command-line key binding. [b2]
@@ -174,23 +179,25 @@
- Added "passwords" and "venkman" dialogs to :dialog. [b2] - Added "passwords" and "venkman" dialogs to :dialog. [b2]
- Added 'wildanchor' option. [b2] - Added 'wildanchor' option. [b2]
- Added 'cookies', 'cookieaccept', and 'cookielifetime' options. [b3] - Added 'cookies', 'cookieaccept', and 'cookielifetime' options. [b3]
* Added BookmarkChange, BookmarkRemove autocommands. [b2] Added [BookmarkChange], [BookmarkRemove] autocommands. [b2]
* Removed the :source line at the end of files generated by Removed the :source line at the end of files generated by
:mkpentadactylrc. [b2] :mkpentadactylrc. [b2]
* gf now toggles between source and content view. gf now toggles between source and content view.
The | key binding has been removed. [b1] The | key binding has been removed. [b1]
* Page zoom information is now shown in the status bar, and Page zoom information is now shown in the status bar, and
change in zoom status no longer appears in :messages. [b1] change in zoom status no longer appears in :messages. [b1]
* Added ZO, ZI, ZM, and ZR as aliases for zO, zI, zM, and zR. [b1] Added n_ZO, n_ZI, n_ZM, and n_ZR as aliases for n_zO, n_zI,
* Completion list now behaves better when the multi-line output n_zM, and n_zR. [b1]
• Completion list now behaves better when the multi-line output
window is displayed. [b1] window is displayed. [b1]
* Major help system improvements: Major help system improvements:
- Plugins may now provide full-fledged :help documentation. [b1] - Plugins may now provide full-fledged :help documentation. [b1]
- Add basic plugin authorship documentation. [b1] - Add basic plugin authorship documentation. [b1]
- The help system is newly modularized and features significant - The help system is newly modularized and features significant
updates, rewrites, and formatting improvements. [b1] updates, rewrites, and formatting improvements. [b1]
- Added <A-F1> to open the single unchunked help page. [b5] - Added <A-F1> to open the single unchunked help page. [b5]
* Removed :beep. [b2] Removed :beep. [b2]
* Removed :edit, :tabedit, and :winedit aliases. [b2] Removed :edit, :tabedit, and :winedit aliases. [b2]
* Removed :play. [b2] Removed :play. [b2]
# vim:set ft=conf sts=2 sw=2 et fo=tcn2 tw=68: