mirror of https://github.com/gdamore/tcell.git
Spelling.
This commit is contained in:
parent
729d178abc
commit
7b5fe1f3ee
|
@ -22,16 +22,16 @@ var cursorClass = "cursor-blinking-block"
|
||||||
|
|
||||||
var content // {data: row[height], dirty: bool}
|
var content // {data: row[height], dirty: bool}
|
||||||
// row = {data: element[width], previous: span}
|
// row = {data: element[width], previous: span}
|
||||||
// dirty/[previous being null] indicates if previous (or entire terminal) needs to be recaclulated.
|
// dirty/[previous being null] indicates if previous (or entire terminal) needs to be recalculated.
|
||||||
// dirty is true/null if terminal/previous need to be re-calculated/shown
|
// dirty is true/null if terminal/previous need to be re-calculated/shown
|
||||||
|
|
||||||
function initialize() {
|
function initialize() {
|
||||||
resize(width, height) // intialize content
|
resize(width, height) // initialize content
|
||||||
show() // then show the screen
|
show() // then show the screen
|
||||||
}
|
}
|
||||||
|
|
||||||
function resize(w, h) {
|
function resize(w, h) {
|
||||||
|
|
||||||
width = w
|
width = w
|
||||||
height = h
|
height = h
|
||||||
content = {data: new Array(height), dirty: true}
|
content = {data: new Array(height), dirty: true}
|
||||||
|
@ -48,7 +48,7 @@ function clearScreen(fg, bg) {
|
||||||
|
|
||||||
content.dirty = true
|
content.dirty = true
|
||||||
for (let i = 0; i < height; i++) {
|
for (let i = 0; i < height; i++) {
|
||||||
content.data[i].previous = null // we set the row to be recacluated later
|
content.data[i].previous = null // we set the row to be recalculated later
|
||||||
for (let j = 0; j < width; j++) {
|
for (let j = 0; j < width; j++) {
|
||||||
content.data[i].data[j] = document.createTextNode(" ") // set the entire row to spaces.
|
content.data[i].data[j] = document.createTextNode(" ") // set the entire row to spaces.
|
||||||
}
|
}
|
||||||
|
@ -61,7 +61,7 @@ function drawCell(x, y, mainc, combc, fg, bg, attrs) {
|
||||||
|
|
||||||
var span = document.createElement("span")
|
var span = document.createElement("span")
|
||||||
var use = false
|
var use = false
|
||||||
|
|
||||||
if (fg) { span.style.color = intToHex(fg); use = true }
|
if (fg) { span.style.color = intToHex(fg); use = true }
|
||||||
if (bg) { span.style.backgroundColor = intToHex(bg); use = true }
|
if (bg) { span.style.backgroundColor = intToHex(bg); use = true }
|
||||||
|
|
||||||
|
@ -195,4 +195,4 @@ document.addEventListener("paste", e => {
|
||||||
const go = new Go();
|
const go = new Go();
|
||||||
WebAssembly.instantiateStreaming(fetch(wasmFilePath), go.importObject).then((result) => {
|
WebAssembly.instantiateStreaming(fetch(wasmFilePath), go.importObject).then((result) => {
|
||||||
go.run(result.instance);
|
go.run(result.instance);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue