Skip to content
Snippets Groups Projects
Commit 7c8626f1 authored by echicken's avatar echicken
Browse files

Removed unused per-item 'rows' attribute from document metadata obj.

Everything has at least the default colour, no need to only fetch
colour for "link" types.
Use console.putmsg P_NOATCODES and P_NOXATTRS via ScrollBox to avoid
danger and messed-up displays.
parent ca2d61d8
No related branches found
No related tags found
No related merge requests found
......@@ -36,7 +36,8 @@ const type_map = {
const scrollbox = new ScrollBox({
y1: 2,
y2: console.screen_rows - 1,
scrollbar: true
scrollbar: true,
putmsg_mode: P_NOATCODES|P_NOXATTRS
});
const state = {
......@@ -321,17 +322,12 @@ function print_document(auto_highlight) {
line = f.readln();
item = JSON.parse(line); // should try/catch
if (!item) continue;
if (is_link(item.type)) {
arr.push(item_color(item.type) + item.text);
} else {
arr.push(item.text);
}
arr.push(item_color(item.type) + item.text);
state.doc.push({
host: item.host,
port: item.port,
selector: item.selector,
type: item.type,
rows: truncsp(word_wrap(item.text, console.screen_columns)).split(/\n/).length
type: item.type
});
}
f.close();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment