From 28abf35b52c31726ad273ad6c82dc79077f7689a Mon Sep 17 00:00:00 2001 From: Max Schaefer <xiemaisi@gmail.com> Date: Mon, 22 May 2017 09:26:55 +0800 Subject: [PATCH] Remove a few useless assignments. --- keymap/vim.js | 1 - mode/css/css.js | 1 - mode/go/go.js | 2 +- mode/haxe/haxe.js | 2 +- mode/jinja2/jinja2.js | 2 +- mode/stylus/stylus.js | 1 - mode/tiki/tiki.js | 2 +- mode/twig/twig.js | 2 +- mode/vb/vb.js | 1 - 9 files changed, 5 insertions(+), 9 deletions(-) diff --git a/keymap/vim.js b/keymap/vim.js index 4b562ea9..7309086c 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 c9570ebf..056c48e6 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 04808adb..36131f10 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 a9573dd7..d159d082 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 ed195581..5d57d134 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 8b1e8eeb..b83be16f 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 5bbd0d79..b4794e43 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 1f2854be..b4e98972 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 d78f91f7..735eb7f7 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 { -- GitLab