« get me outta code hell

tui-lib - Pure Node.js library for making visual command-line programs (ala vim, ncdu)
about summary refs log tree commit diff
path: root/ui
diff options
context:
space:
mode:
Diffstat (limited to 'ui')
-rw-r--r--ui/DisplayElement.js4
-rw-r--r--ui/HorizontalBox.js2
-rw-r--r--ui/Root.js2
3 files changed, 4 insertions, 4 deletions
diff --git a/ui/DisplayElement.js b/ui/DisplayElement.js
index 3a97ed9..75263ac 100644
--- a/ui/DisplayElement.js
+++ b/ui/DisplayElement.js
@@ -64,7 +64,7 @@ module.exports = class DisplayElement extends EventEmitter {
     // Runs fixLayout on this as well as all children.
 
     this.fixLayout()
-    for (let child of this.children) {
+    for (const child of this.children) {
       child.fixAllLayout()
     }
   }
@@ -72,7 +72,7 @@ module.exports = class DisplayElement extends EventEmitter {
   drawChildrenTo(writable) {
     // Draws all of the children to a writable.
 
-    for (let child of this.children) {
+    for (const child of this.children) {
       child.renderTo(writable)
     }
   }
diff --git a/ui/HorizontalBox.js b/ui/HorizontalBox.js
index fd43f8e..f92bf10 100644
--- a/ui/HorizontalBox.js
+++ b/ui/HorizontalBox.js
@@ -5,7 +5,7 @@ module.exports = class HorizontalBox extends DisplayElement {
 
   fixLayout() {
     let nextX = 0
-    for (let child of this.children) {
+    for (const child of this.children) {
       child.x = nextX
       nextX = child.right + 1
     }
diff --git a/ui/Root.js b/ui/Root.js
index d306a41..b0364e2 100644
--- a/ui/Root.js
+++ b/ui/Root.js
@@ -29,7 +29,7 @@ module.exports = class Root extends DisplayElement {
   handleData(buffer) {
     if (this.selected) {
       const els = this.selected.directAncestors.concat([this.selected])
-      for (let el of els) {
+      for (const el of els) {
         if (el instanceof FocusElement) {
           const shouldBreak = (el.keyPressed(buffer) === false)
           if (shouldBreak) {