]> git.proxmox.com Git - mirror_xterm.js.git/commitdiff
Use string interpolation
authorDaniel Imms <daimms@microsoft.com>
Sun, 14 May 2017 21:26:45 +0000 (14:26 -0700)
committerDaniel Imms <daimms@microsoft.com>
Sun, 14 May 2017 21:26:45 +0000 (14:26 -0700)
src/Renderer.ts

index 85d57eb93f8d7397bd7d11e4cab63d297eacbe13..8f0ca5db32514933c7a28e887e70d6fabdcbc52c 100644 (file)
@@ -256,18 +256,19 @@ export class Renderer {
               }
 
               if (bg < 256) {
-                currentElement.classList.add('xterm-bg-color-' + bg);
+                currentElement.classList.add(`xterm-bg-color-${bg}`);
               }
 
               if (fg < 256) {
-                currentElement.classList.add('xterm-color-' + fg);
+                currentElement.classList.add(`xterm-color-${fg}`);
               }
             }
           }
         }
 
         if (ch_width === 2) {
-          // Wrap wide characters so they're sized correctly
+          // Wrap wide characters so they're sized correctly. It's more difficult to release these
+          // from the object pool so just create new ones via innerHTML.
           innerHTML += `<span class="xterm-wide-char">${ch}</span>`;
         } else if (ch.charCodeAt(0) > 255) {
           // Wrap any non-wide unicode character as some fonts size them badly
@@ -320,8 +321,7 @@ export class Renderer {
 }
 
 
-// if bold is broken, we can't
-// use it in the terminal.
+// If bold is broken, we can't use it in the terminal.
 function checkBoldBroken(terminal) {
   const document = terminal.ownerDocument;
   const el = document.createElement('span');