mirror of
https://github.com/Horizontal42/summarum.git
synced 2026-11-10 18:01:59 +03:00
show unresolved cross-sheet references as a visible #ref? marker
This commit is contained in:
parent
9d8f977c46
commit
90c19e343f
2 changed files with 12 additions and 4 deletions
|
|
@ -21,6 +21,7 @@
|
||||||
--border: #e4e4e0;
|
--border: #e4e4e0;
|
||||||
--sel: #cfe3f7;
|
--sel: #cfe3f7;
|
||||||
--caret: #d57d2c;
|
--caret: #d57d2c;
|
||||||
|
--error: #c1443a;
|
||||||
--toolbar-bg: #fafaf8;
|
--toolbar-bg: #fafaf8;
|
||||||
--hover: #ececea;
|
--hover: #ececea;
|
||||||
}
|
}
|
||||||
|
|
@ -41,6 +42,7 @@
|
||||||
--border: #333438;
|
--border: #333438;
|
||||||
--sel: #2d4a68;
|
--sel: #2d4a68;
|
||||||
--caret: #e8923c;
|
--caret: #e8923c;
|
||||||
|
--error: #e2685c;
|
||||||
--toolbar-bg: #232428;
|
--toolbar-bg: #232428;
|
||||||
--hover: #2f3035;
|
--hover: #2f3035;
|
||||||
}
|
}
|
||||||
|
|
@ -332,6 +334,10 @@ body {
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
}
|
}
|
||||||
.result-line:hover { text-decoration: underline; }
|
.result-line:hover { text-decoration: underline; }
|
||||||
|
.result-line.result-error {
|
||||||
|
color: var(--error);
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
.result-sparkline {
|
.result-sparkline {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right: 14px;
|
right: 14px;
|
||||||
|
|
|
||||||
|
|
@ -324,7 +324,8 @@ export class SumEditor {
|
||||||
for (let i = 0; i < Math.min(this.results.length, doc.lines); i++) {
|
for (let i = 0; i < Math.min(this.results.length, doc.lines); i++) {
|
||||||
const r = this.results[i];
|
const r = this.results[i];
|
||||||
const isChart = r.value?.kind === "chart";
|
const isChart = r.value?.kind === "chart";
|
||||||
if (!r.text && !isChart) continue;
|
const isError = !!r.error;
|
||||||
|
if (!r.text && !isChart && !isError) continue;
|
||||||
const line = doc.line(i + 1);
|
const line = doc.line(i + 1);
|
||||||
const block = this.view.lineBlockAt(line.from);
|
const block = this.view.lineBlockAt(line.from);
|
||||||
const top = docTop + block.top - overlayTop;
|
const top = docTop + block.top - overlayTop;
|
||||||
|
|
@ -333,9 +334,10 @@ export class SumEditor {
|
||||||
frag.appendChild(buildSparkline(r.value.points.map((p) => p.toNumber()), top));
|
frag.appendChild(buildSparkline(r.value.points.map((p) => p.toNumber()), top));
|
||||||
} else {
|
} else {
|
||||||
const el = document.createElement("div");
|
const el = document.createElement("div");
|
||||||
el.className = "result-line";
|
el.className = "result-line" + (isError ? " result-error" : "");
|
||||||
el.textContent = r.text;
|
el.textContent = isError ? "#ref?" : r.text;
|
||||||
el.dataset.value = r.text!;
|
if (!isError) el.dataset.value = r.text!;
|
||||||
|
if (isError) el.title = r.error!;
|
||||||
el.style.top = `${top}px`;
|
el.style.top = `${top}px`;
|
||||||
frag.appendChild(el);
|
frag.appendChild(el);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue