From c3d22466ca870b0bc104ca4b79e74a92aee26916 Mon Sep 17 00:00:00 2001
From: Michael Zhou <zhoumotongxue008@gmail.com>
Date: Sun, 27 Mar 2016 22:45:27 -0400
Subject: [PATCH] [vim bindings] Remove dead code and initialize a property

The Error after the while(true) loop is not reachable and should
be removed. The "this.iterator" property should be given an
initial value of 0. This fixes two warnings reported by Closure
Compiler.
---
 keymap/vim.js | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/keymap/vim.js b/keymap/vim.js
index 54f282724..b7e8d8588 100644
--- a/keymap/vim.js
+++ b/keymap/vim.js
@@ -1048,7 +1048,7 @@
     };
     function HistoryController() {
         this.historyBuffer = [];
-        this.iterator;
+        this.iterator = 0;
         this.initialPrefix = null;
     }
     HistoryController.prototype = {
@@ -3290,8 +3290,6 @@
         line = cm.getLine(lineNum);
         pos = (dir > 0) ? 0 : line.length;
       }
-      // Should never get here.
-      throw new Error('The impossible happened.');
     }
 
     /**
-- 
GitLab