From e098ceb6eabb29fcf0a3cc1051e1caf63a2789a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Hru=C5=A1ka?= Date: Mon, 18 Sep 2017 23:14:43 +0200 Subject: [PATCH] use U+00XX for unicode in debugbar --- js/debug_screen.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/js/debug_screen.js b/js/debug_screen.js index 8dce880..0926a77 100644 --- a/js/debug_screen.js +++ b/js/debug_screen.js @@ -172,6 +172,9 @@ module.exports = function attachDebugScreen (screen) { let cellBG = screen.screenBG[cursorCell] let cellCode = (screen.screen[cursorCell] || '').codePointAt(0) let cellAttrs = screen.screenAttrs[cursorCell] - toolbar.textContent = `Rudimentary debug toolbar. Cursor cell (${cursorCell}): u+${cellCode.toString(16)} FG: ${cellFG} BG: ${cellBG} Attrs: ${cellAttrs.toString(2)}` + let hexcode = cellCode.toString(16).toUpperCase() + if (hexcode.length < 4) hexcode = `0000${hexcode}`.substr(-4) + hexcode = `U+${hexcode}` + toolbar.textContent = `Cursor cell (${cursorCell}): ${hexcode} FG: ${cellFG} BG: ${cellBG} Attrs: ${cellAttrs.toString(2)}` }) }