1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-20 04:07:59 +01:00

Don't output blank lines for empty pageinfo sections.

This commit is contained in:
Doug Kearns
2011-01-23 17:12:37 +11:00
parent 7d50100d67
commit 79247daec7
2 changed files with 4 additions and 6 deletions

View File

@@ -486,7 +486,7 @@ var Buffer = Module("buffer", {
* section's output.
*/
addPageInfoSection: function addPageInfoSection(option, title, func) {
this.pageInfo[option] = [func, title];
this.pageInfo[option] = [func, title]; // TODO: are these reversed intentionally? --djk
},
/**
@@ -1023,10 +1023,9 @@ var Buffer = Module("buffer", {
return;
}
let option = sections || options["pageinfo"];
let list = template.map(option, function (option) {
let opt = buffer.pageInfo[option];
return opt ? template.table(opt[1], opt[0](true)) : undefined;
let list = template.map(sections || options["pageinfo"], function (option) {
let [data, title] = buffer.pageInfo[option];
return template.table(title, data(true));
}, <br/>);
dactyl.echo(list, commandline.FORCE_MULTILINE);
},