diff --git a/keymap/vim.js b/keymap/vim.js
index 4b562ea9c767e2bedab4d4f37ea499a0f6e63bb8..7309086c51b83beed2764ce0b9f90ec73b5a275d 100644
--- a/keymap/vim.js
+++ b/keymap/vim.js
@@ -2815,7 +2815,6 @@
         var range = {anchor: new Pos(line, baseCh), head: new Pos(line, headCh)};
         selections.push(range);
       }
-      primIndex = head.line == lastLine ? selections.length - 1 : 0;
       cm.setSelections(selections);
       selectionEnd.ch = headCh;
       base.ch = baseCh;
diff --git a/mode/css/css.js b/mode/css/css.js
index c9570ebfabeaa2395f5fb0e8528c955ca94461c7..056c48e680948c2c1753b974ec7fca34d7a3c3a1 100644
--- a/mode/css/css.js
+++ b/mode/css/css.js
@@ -401,7 +401,6 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
             ch == "{" && (cx.type == "at" || cx.type == "atBlock")) {
           // Dedent relative to current context.
           indent = Math.max(0, cx.indent - indentUnit);
-          cx = cx.prev;
         }
       }
       return indent;
diff --git a/mode/go/go.js b/mode/go/go.js
index 04808adb6f765d3160a81e79ac42f6c00dabbc52..36131f10fe91c93375305cd86cd504fbcb13e786 100644
--- a/mode/go/go.js
+++ b/mode/go/go.js
@@ -155,7 +155,7 @@ CodeMirror.defineMode("go", function(config) {
       else if (curPunc == "[") pushContext(state, stream.column(), "]");
       else if (curPunc == "(") pushContext(state, stream.column(), ")");
       else if (curPunc == "case") ctx.type = "case";
-      else if (curPunc == "}" && ctx.type == "}") ctx = popContext(state);
+      else if (curPunc == "}" && ctx.type == "}") popContext(state);
       else if (curPunc == ctx.type) popContext(state);
       state.startOfLine = false;
       return style;
diff --git a/mode/haxe/haxe.js b/mode/haxe/haxe.js
index a9573dd71b5981cf8814649a79b5d8ea0e27d66d..d159d082e96b815bf3d151fc7070feedd245855b 100644
--- a/mode/haxe/haxe.js
+++ b/mode/haxe/haxe.js
@@ -485,7 +485,7 @@ CodeMirror.defineMode("hxml", function () {
 
       if (state.inString == false && ch == "'") {
         state.inString = true;
-        ch = stream.next();
+        stream.next();
       }
 
       if (state.inString == true) {
diff --git a/mode/jinja2/jinja2.js b/mode/jinja2/jinja2.js
index ed195581cfb3d66f239c8edbf06849ead6a32445..5d57d134488f7babd33fd6cf672a5ce8ee053100 100644
--- a/mode/jinja2/jinja2.js
+++ b/mode/jinja2/jinja2.js
@@ -107,7 +107,7 @@
         }
         return "variable";
       } else if (stream.eat("{")) {
-        if (ch = stream.eat("#")) {
+        if (stream.eat("#")) {
           state.incomment = true;
           if(!stream.skipTo("#}")) {
             stream.skipToEnd();
diff --git a/mode/stylus/stylus.js b/mode/stylus/stylus.js
index 8b1e8eeb143abbcf318b067a40d93adb14aec94d..b83be16f42b617f366828e9c9d51234216665f14 100644
--- a/mode/stylus/stylus.js
+++ b/mode/stylus/stylus.js
@@ -684,7 +684,6 @@
              ch == ")" && (cx.type == "parens" || cx.type == "atBlock_parens") ||
              ch == "{" && (cx.type == "at"))) {
           indent = cx.indent - indentUnit;
-          cx = cx.prev;
         } else if (!(/(\})/.test(ch))) {
           if (/@|\$|\d/.test(ch) ||
               /^\{/.test(textAfter) ||
diff --git a/mode/tiki/tiki.js b/mode/tiki/tiki.js
index 5bbd0d790ba89b2d711ee2ba2c96180d470f984c..b4794e4334ee65fd9feb01b4e0688f5aaac2b2ff 100644
--- a/mode/tiki/tiki.js
+++ b/mode/tiki/tiki.js
@@ -144,7 +144,7 @@ CodeMirror.defineMode('tiki', function(config) {
       type = "equals";
 
       if (peek == ">") {
-        ch = stream.next();
+        stream.next();
         peek = stream.peek();
       }
 
diff --git a/mode/twig/twig.js b/mode/twig/twig.js
index 1f2854bef21a2cb56dfb6e03e84d0f2abd935115..b4e98972bcf677929479525cf348b9ecb8e11d38 100644
--- a/mode/twig/twig.js
+++ b/mode/twig/twig.js
@@ -95,7 +95,7 @@
         }
         return "variable";
       } else if (stream.eat("{")) {
-        if (ch = stream.eat("#")) {
+        if (stream.eat("#")) {
           state.incomment = true;
           if (!stream.skipTo("#}")) {
             stream.skipToEnd();
diff --git a/mode/vb/vb.js b/mode/vb/vb.js
index d78f91f701c7b421cc38477bad388928d35aafc7..735eb7f7e81424dd1d6cede6e50e9121655e737b 100644
--- a/mode/vb/vb.js
+++ b/mode/vb/vb.js
@@ -202,7 +202,6 @@ CodeMirror.defineMode("vb", function(conf, parserConf) {
         // Handle '.' connected identifiers
         if (current === '.') {
             style = state.tokenize(stream, state);
-            current = stream.current();
             if (style === 'variable') {
                 return 'variable';
             } else {