All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ber-security.graylog.graylog-plugin-correlation-count.6.0.0.source-code.d09463c099fb2c44719380623a5c68fb.js.map Maven / Gradle / Ivy

There is a newer version: 5.1.3
Show newest version
{"version":3,"sources":["webpack://CorrelationCount/d09463c099fb2c44719380623a5c68fb.js"],"sourcesContent":["ace.define(\"ace/ext/hardwrap\",[\"require\",\"exports\",\"module\",\"ace/range\",\"ace/editor\",\"ace/config\"], function(require, exports, module){\"use strict\";\nvar Range = require(\"../range\").Range;\nfunction hardWrap(editor, options) {\n    var max = options.column || editor.getOption(\"printMarginColumn\");\n    var allowMerge = options.allowMerge != false;\n    var row = Math.min(options.startRow, options.endRow);\n    var endRow = Math.max(options.startRow, options.endRow);\n    var session = editor.session;\n    while (row <= endRow) {\n        var line = session.getLine(row);\n        if (line.length > max) {\n            var space = findSpace(line, max, 5);\n            if (space) {\n                var indentation = /^\\s*/.exec(line)[0];\n                session.replace(new Range(row, space.start, row, space.end), \"\\n\" + indentation);\n            }\n            endRow++;\n        }\n        else if (allowMerge && /\\S/.test(line) && row != endRow) {\n            var nextLine = session.getLine(row + 1);\n            if (nextLine && /\\S/.test(nextLine)) {\n                var trimmedLine = line.replace(/\\s+$/, \"\");\n                var trimmedNextLine = nextLine.replace(/^\\s+/, \"\");\n                var mergedLine = trimmedLine + \" \" + trimmedNextLine;\n                var space = findSpace(mergedLine, max, 5);\n                if (space && space.start > trimmedLine.length || mergedLine.length < max) {\n                    var replaceRange = new Range(row, trimmedLine.length, row + 1, nextLine.length - trimmedNextLine.length);\n                    session.replace(replaceRange, \" \");\n                    row--;\n                    endRow--;\n                }\n                else if (trimmedLine.length < line.length) {\n                    session.remove(new Range(row, trimmedLine.length, row, line.length));\n                }\n            }\n        }\n        row++;\n    }\n    function findSpace(line, max, min) {\n        if (line.length < max)\n            return;\n        var before = line.slice(0, max);\n        var after = line.slice(max);\n        var spaceAfter = /^(?:(\\s+)|(\\S+)(\\s+))/.exec(after);\n        var spaceBefore = /(?:(\\s+)|(\\s+)(\\S+))$/.exec(before);\n        var start = 0;\n        var end = 0;\n        if (spaceBefore && !spaceBefore[2]) {\n            start = max - spaceBefore[1].length;\n            end = max;\n        }\n        if (spaceAfter && !spaceAfter[2]) {\n            if (!start)\n                start = max;\n            end = max + spaceAfter[1].length;\n        }\n        if (start) {\n            return {\n                start: start,\n                end: end\n            };\n        }\n        if (spaceBefore && spaceBefore[2] && spaceBefore.index > min) {\n            return {\n                start: spaceBefore.index,\n                end: spaceBefore.index + spaceBefore[2].length\n            };\n        }\n        if (spaceAfter && spaceAfter[2]) {\n            start = max + spaceAfter[2].length;\n            return {\n                start: start,\n                end: start + spaceAfter[3].length\n            };\n        }\n    }\n}\nfunction wrapAfterInput(e) {\n    if (e.command.name == \"insertstring\" && /\\S/.test(e.args)) {\n        var editor = e.editor;\n        var cursor = editor.selection.cursor;\n        if (cursor.column <= editor.renderer.$printMarginColumn)\n            return;\n        var lastDelta = editor.session.$undoManager.$lastDelta;\n        hardWrap(editor, {\n            startRow: cursor.row, endRow: cursor.row,\n            allowMerge: false\n        });\n        if (lastDelta != editor.session.$undoManager.$lastDelta)\n            editor.session.markUndoGroup();\n    }\n}\nvar Editor = require(\"../editor\").Editor;\nrequire(\"../config\").defineOptions(Editor.prototype, \"editor\", {\n    hardWrap: {\n        set: function (val) {\n            if (val) {\n                this.commands.on(\"afterExec\", wrapAfterInput);\n            }\n            else {\n                this.commands.off(\"afterExec\", wrapAfterInput);\n            }\n        },\n        value: false\n    }\n});\nexports.hardWrap = hardWrap;\n\n});\n\nace.define(\"ace/keyboard/vim\",[\"require\",\"exports\",\"module\",\"ace/range\",\"ace/lib/event_emitter\",\"ace/lib/dom\",\"ace/lib/oop\",\"ace/lib/keys\",\"ace/lib/event\",\"ace/search\",\"ace/lib/useragent\",\"ace/search_highlight\",\"ace/commands/multi_select_commands\",\"ace/mode/text\",\"ace/ext/hardwrap\",\"ace/multi_select\"], function(require, exports, module){// CodeMirror, copyright (c) by Marijn Haverbeke and others\n'use strict';\nfunction log() {\n    var d = \"\";\n    function format(p) {\n        if (typeof p != \"object\")\n            return p + \"\";\n        if (\"line\" in p) {\n            return p.line + \":\" + p.ch;\n        }\n        if (\"anchor\" in p) {\n            return format(p.anchor) + \"->\" + format(p.head);\n        }\n        if (Array.isArray(p))\n            return \"[\" + p.map(function (x) {\n                return format(x);\n            }) + \"]\";\n        return JSON.stringify(p);\n    }\n    for (var i = 0; i < arguments.length; i++) {\n        var p = arguments[i];\n        var f = format(p);\n        d += f + \"  \";\n    }\n    console.log(d);\n}\nvar Range = require(\"../range\").Range;\nvar EventEmitter = require(\"../lib/event_emitter\").EventEmitter;\nvar domLib = require(\"../lib/dom\");\nvar oop = require(\"../lib/oop\");\nvar KEYS = require(\"../lib/keys\");\nvar event = require(\"../lib/event\");\nvar Search = require(\"../search\").Search;\nvar useragent = require(\"../lib/useragent\");\nvar SearchHighlight = require(\"../search_highlight\").SearchHighlight;\nvar multiSelectCommands = require(\"../commands/multi_select_commands\");\nvar TextModeTokenRe = require(\"../mode/text\").Mode.prototype.tokenRe;\nvar hardWrap = require(\"../ext/hardwrap\").hardWrap;\nrequire(\"../multi_select\");\nvar CodeMirror = function (ace) {\n    this.ace = ace;\n    this.state = {};\n    this.marks = {};\n    this.options = {};\n    this.$uid = 0;\n    this.onChange = this.onChange.bind(this);\n    this.onSelectionChange = this.onSelectionChange.bind(this);\n    this.onBeforeEndOperation = this.onBeforeEndOperation.bind(this);\n    this.ace.on('change', this.onChange);\n    this.ace.on('changeSelection', this.onSelectionChange);\n    this.ace.on('beforeEndOperation', this.onBeforeEndOperation);\n};\nCodeMirror.Pos = function (line, ch) {\n    if (!(this instanceof Pos))\n        return new Pos(line, ch);\n    this.line = line;\n    this.ch = ch;\n};\nCodeMirror.defineOption = function (name, val, setter) { };\nCodeMirror.commands = {\n    redo: function (cm) { cm.ace.redo(); },\n    undo: function (cm) { cm.ace.undo(); },\n    newlineAndIndent: function (cm) { cm.ace.insert(\"\\n\"); },\n    goLineLeft: function (cm) { cm.ace.selection.moveCursorLineStart(); },\n    goLineRight: function (cm) { cm.ace.selection.moveCursorLineEnd(); }\n};\nCodeMirror.keyMap = {};\nCodeMirror.addClass = CodeMirror.rmClass = function () { };\nCodeMirror.e_stop = CodeMirror.e_preventDefault = event.stopEvent;\nCodeMirror.keyName = function (e) {\n    var key = (KEYS[e.keyCode] || e.key || \"\");\n    if (key.length == 1)\n        key = key.toUpperCase();\n    key = event.getModifierString(e).replace(/(^|-)\\w/g, function (m) {\n        return m.toUpperCase();\n    }) + key;\n    return key;\n};\nCodeMirror.keyMap['default'] = function (key) {\n    return function (cm) {\n        var cmd = cm.ace.commands.commandKeyBinding[key.toLowerCase()];\n        return cmd && cm.ace.execCommand(cmd) !== false;\n    };\n};\nCodeMirror.lookupKey = function lookupKey(key, map, handle) {\n    if (!map)\n        map = \"default\";\n    if (typeof map == \"string\")\n        map = CodeMirror.keyMap[map] || CodeMirror.keyMap['default'];\n    var found = typeof map == \"function\" ? map(key) : map[key];\n    if (found === false)\n        return \"nothing\";\n    if (found === \"...\")\n        return \"multi\";\n    if (found != null && handle(found))\n        return \"handled\";\n    if (map.fallthrough) {\n        if (!Array.isArray(map.fallthrough))\n            return lookupKey(key, map.fallthrough, handle);\n        for (var i = 0; i < map.fallthrough.length; i++) {\n            var result = lookupKey(key, map.fallthrough[i], handle);\n            if (result)\n                return result;\n        }\n    }\n};\nCodeMirror.findMatchingTag = function (cm, head) {\n    return cm.findMatchingTag(head);\n};\nCodeMirror.findEnclosingTag = function (cm, head) {\n};\nCodeMirror.signal = function (o, name, e) { return o._signal(name, e); };\nCodeMirror.on = event.addListener;\nCodeMirror.off = event.removeListener;\nCodeMirror.isWordChar = function (ch) {\n    if (ch < \"\\x7f\")\n        return /^\\w$/.test(ch);\n    TextModeTokenRe.lastIndex = 0;\n    return TextModeTokenRe.test(ch);\n};\n(function () {\n    oop.implement(CodeMirror.prototype, EventEmitter);\n    this.destroy = function () {\n        this.ace.off('change', this.onChange);\n        this.ace.off('changeSelection', this.onSelectionChange);\n        this.ace.off('beforeEndOperation', this.onBeforeEndOperation);\n        this.removeOverlay();\n    };\n    this.virtualSelectionMode = function () {\n        return this.ace.inVirtualSelectionMode && this.ace.selection.index;\n    };\n    this.onChange = function (delta) {\n        if (this.$lineHandleChanges) {\n            this.$lineHandleChanges.push(delta);\n        }\n        var change = { text: delta.action[0] == 'i' ? delta.lines : [] };\n        var curOp = this.curOp = this.curOp || {};\n        if (!curOp.changeHandlers)\n            curOp.changeHandlers = this._eventRegistry[\"change\"] && this._eventRegistry[\"change\"].slice();\n        if (!curOp.lastChange) {\n            curOp.lastChange = curOp.change = change;\n        }\n        else {\n            curOp.lastChange.next = curOp.lastChange = change;\n        }\n        this.$updateMarkers(delta);\n    };\n    this.onSelectionChange = function () {\n        var curOp = this.curOp = this.curOp || {};\n        if (!curOp.cursorActivityHandlers)\n            curOp.cursorActivityHandlers = this._eventRegistry[\"cursorActivity\"] && this._eventRegistry[\"cursorActivity\"].slice();\n        this.curOp.cursorActivity = true;\n        if (this.ace.inMultiSelectMode) {\n            this.ace.keyBinding.removeKeyboardHandler(multiSelectCommands.keyboardHandler);\n        }\n    };\n    this.operation = function (fn, force) {\n        if (!force && this.curOp || force && this.curOp && this.curOp.force) {\n            return fn();\n        }\n        if (force || !this.ace.curOp) {\n            if (this.curOp)\n                this.onBeforeEndOperation();\n        }\n        if (!this.ace.curOp) {\n            var prevOp = this.ace.prevOp;\n            this.ace.startOperation({\n                command: { name: \"vim\", scrollIntoView: \"cursor\" }\n            });\n        }\n        var curOp = this.curOp = this.curOp || {};\n        this.curOp.force = force;\n        var result = fn();\n        if (this.ace.curOp && this.ace.curOp.command.name == \"vim\") {\n            if (this.state.dialog)\n                this.ace.curOp.command.scrollIntoView = this.ace.curOp.vimDialogScroll;\n            this.ace.endOperation();\n            if (!curOp.cursorActivity && !curOp.lastChange && prevOp)\n                this.ace.prevOp = prevOp;\n        }\n        if (force || !this.ace.curOp) {\n            if (this.curOp)\n                this.onBeforeEndOperation();\n        }\n        return result;\n    };\n    this.onBeforeEndOperation = function () {\n        var op = this.curOp;\n        if (op) {\n            if (op.change) {\n                this.signal(\"change\", op.change, op);\n            }\n            if (op && op.cursorActivity) {\n                this.signal(\"cursorActivity\", null, op);\n            }\n            this.curOp = null;\n        }\n    };\n    this.signal = function (eventName, e, handlers) {\n        var listeners = handlers ? handlers[eventName + \"Handlers\"]\n            : (this._eventRegistry || {})[eventName];\n        if (!listeners)\n            return;\n        listeners = listeners.slice();\n        for (var i = 0; i < listeners.length; i++)\n            listeners[i](this, e);\n    };\n    this.firstLine = function () { return 0; };\n    this.lastLine = function () { return this.ace.session.getLength() - 1; };\n    this.lineCount = function () { return this.ace.session.getLength(); };\n    this.setCursor = function (line, ch) {\n        if (typeof line === 'object') {\n            ch = line.ch;\n            line = line.line;\n        }\n        var shouldScroll = !this.curOp && !this.ace.inVirtualSelectionMode;\n        if (!this.ace.inVirtualSelectionMode)\n            this.ace.exitMultiSelectMode();\n        this.ace.session.unfold({ row: line, column: ch });\n        this.ace.selection.moveTo(line, ch);\n        if (shouldScroll) {\n            this.ace.renderer.scrollCursorIntoView();\n            this.ace.endOperation();\n        }\n    };\n    this.getCursor = function (p) {\n        var sel = this.ace.selection;\n        var pos = p == 'anchor' ? (sel.isEmpty() ? sel.lead : sel.anchor) :\n            p == 'head' || !p ? sel.lead : sel.getRange()[p];\n        return toCmPos(pos);\n    };\n    this.listSelections = function (p) {\n        var ranges = this.ace.multiSelect.rangeList.ranges;\n        if (!ranges.length || this.ace.inVirtualSelectionMode)\n            return [{ anchor: this.getCursor('anchor'), head: this.getCursor('head') }];\n        return ranges.map(function (r) {\n            return {\n                anchor: this.clipPos(toCmPos(r.cursor == r.end ? r.start : r.end)),\n                head: this.clipPos(toCmPos(r.cursor))\n            };\n        }, this);\n    };\n    this.setSelections = function (p, primIndex) {\n        var sel = this.ace.multiSelect;\n        var ranges = p.map(function (x) {\n            var anchor = toAcePos(x.anchor);\n            var head = toAcePos(x.head);\n            var r = Range.comparePoints(anchor, head) < 0\n                ? new Range.fromPoints(anchor, head)\n                : new Range.fromPoints(head, anchor);\n            r.cursor = Range.comparePoints(r.start, head) ? r.end : r.start;\n            return r;\n        });\n        if (this.ace.inVirtualSelectionMode) {\n            this.ace.selection.fromOrientedRange(ranges[0]);\n            return;\n        }\n        if (!primIndex) {\n            ranges = ranges.reverse();\n        }\n        else if (ranges[primIndex]) {\n            ranges.push(ranges.splice(primIndex, 1)[0]);\n        }\n        sel.toSingleRange(ranges[0].clone());\n        var session = this.ace.session;\n        for (var i = 0; i < ranges.length; i++) {\n            var range = session.$clipRangeToDocument(ranges[i]); // todo why ace doesn't do this?\n            sel.addRange(range);\n        }\n    };\n    this.setSelection = function (a, h, options) {\n        var sel = this.ace.selection;\n        sel.moveTo(a.line, a.ch);\n        sel.selectTo(h.line, h.ch);\n        if (options && options.origin == '*mouse') {\n            this.onBeforeEndOperation();\n        }\n    };\n    this.somethingSelected = function (p) {\n        return !this.ace.selection.isEmpty();\n    };\n    this.clipPos = function (p) {\n        var pos = this.ace.session.$clipPositionToDocument(p.line, p.ch);\n        return toCmPos(pos);\n    };\n    this.foldCode = function (pos) {\n        this.ace.session.$toggleFoldWidget(pos.line, {});\n    };\n    this.markText = function (cursor) {\n        return { clear: function () { }, find: function () { } };\n    };\n    this.$updateMarkers = function (delta) {\n        var isInsert = delta.action == \"insert\";\n        var start = delta.start;\n        var end = delta.end;\n        var rowShift = (end.row - start.row) * (isInsert ? 1 : -1);\n        var colShift = (end.column - start.column) * (isInsert ? 1 : -1);\n        if (isInsert)\n            end = start;\n        for (var i in this.marks) {\n            var point = this.marks[i];\n            var cmp = Range.comparePoints(point, start);\n            if (cmp < 0) {\n                continue; // delta starts after the range\n            }\n            if (cmp === 0) {\n                if (isInsert) {\n                    if (!point.$insertRight) {\n                        cmp = 1;\n                    }\n                    else if (point.bias == 1) {\n                        cmp = 1;\n                    }\n                    else {\n                        point.bias = -1;\n                        continue;\n                    }\n                }\n            }\n            var cmp2 = isInsert ? cmp : Range.comparePoints(point, end);\n            if (cmp2 > 0) {\n                point.row += rowShift;\n                point.column += point.row == end.row ? colShift : 0;\n                continue;\n            }\n            if (!isInsert && cmp2 <= 0) {\n                point.row = start.row;\n                point.column = start.column;\n                if (cmp2 === 0)\n                    point.bias = 1;\n            }\n        }\n    };\n    var Marker = function (cm, id, row, column) {\n        this.cm = cm;\n        this.id = id;\n        this.row = row;\n        this.column = column;\n        cm.marks[this.id] = this;\n    };\n    Marker.prototype.clear = function () { delete this.cm.marks[this.id]; };\n    Marker.prototype.find = function () { return toCmPos(this); };\n    this.setBookmark = function (cursor, options) {\n        var bm = new Marker(this, this.$uid++, cursor.line, cursor.ch);\n        if (!options || !options.insertLeft)\n            bm.$insertRight = true;\n        this.marks[bm.id] = bm;\n        return bm;\n    };\n    this.moveH = function (increment, unit) {\n        if (unit == 'char') {\n            var sel = this.ace.selection;\n            sel.clearSelection();\n            sel.moveCursorBy(0, increment);\n        }\n    };\n    this.findPosV = function (start, amount, unit, goalColumn) {\n        if (unit == 'page') {\n            var renderer = this.ace.renderer;\n            var config = renderer.layerConfig;\n            amount = amount * Math.floor(config.height / config.lineHeight);\n            unit = 'line';\n        }\n        if (unit == 'line') {\n            var screenPos = this.ace.session.documentToScreenPosition(start.line, start.ch);\n            if (goalColumn != null)\n                screenPos.column = goalColumn;\n            screenPos.row += amount;\n            screenPos.row = Math.min(Math.max(0, screenPos.row), this.ace.session.getScreenLength() - 1);\n            var pos = this.ace.session.screenToDocumentPosition(screenPos.row, screenPos.column);\n            return toCmPos(pos);\n        }\n        else {\n            debugger;\n        }\n    };\n    this.charCoords = function (pos, mode) {\n        if (mode == 'div' || !mode) {\n            var sc = this.ace.session.documentToScreenPosition(pos.line, pos.ch);\n            return { left: sc.column, top: sc.row };\n        }\n        if (mode == 'local') {\n            var renderer = this.ace.renderer;\n            var sc = this.ace.session.documentToScreenPosition(pos.line, pos.ch);\n            var lh = renderer.layerConfig.lineHeight;\n            var cw = renderer.layerConfig.characterWidth;\n            var top = lh * sc.row;\n            return { left: sc.column * cw, top: top, bottom: top + lh };\n        }\n    };\n    this.coordsChar = function (pos, mode) {\n        var renderer = this.ace.renderer;\n        if (mode == 'local') {\n            var row = Math.max(0, Math.floor(pos.top / renderer.lineHeight));\n            var col = Math.max(0, Math.floor(pos.left / renderer.characterWidth));\n            var ch = renderer.session.screenToDocumentPosition(row, col);\n            return toCmPos(ch);\n        }\n        else if (mode == 'div') {\n            throw \"not implemented\";\n        }\n    };\n    this.getSearchCursor = function (query, pos, caseFold) {\n        var caseSensitive = false;\n        var isRegexp = false;\n        if (query instanceof RegExp && !query.global) {\n            caseSensitive = !query.ignoreCase;\n            query = query.source;\n            isRegexp = true;\n        }\n        if (query == \"\\\\n\") {\n            query = \"\\n\";\n            isRegexp = false;\n        }\n        var search = new Search();\n        if (pos.ch == undefined)\n            pos.ch = Number.MAX_VALUE;\n        var acePos = { row: pos.line, column: pos.ch };\n        var cm = this;\n        var last = null;\n        return {\n            findNext: function () { return this.find(false); },\n            findPrevious: function () { return this.find(true); },\n            find: function (back) {\n                search.setOptions({\n                    needle: query,\n                    caseSensitive: caseSensitive,\n                    wrap: false,\n                    backwards: back,\n                    regExp: isRegexp,\n                    start: last || acePos\n                });\n                var range = search.find(cm.ace.session);\n                last = range;\n                return last && [!last.isEmpty()];\n            },\n            from: function () { return last && toCmPos(last.start); },\n            to: function () { return last && toCmPos(last.end); },\n            replace: function (text) {\n                if (last) {\n                    last.end = cm.ace.session.doc.replace(last, text);\n                }\n            }\n        };\n    };\n    this.scrollTo = function (x, y) {\n        var renderer = this.ace.renderer;\n        var config = renderer.layerConfig;\n        var maxHeight = config.maxHeight;\n        maxHeight -= (renderer.$size.scrollerHeight - renderer.lineHeight) * renderer.$scrollPastEnd;\n        if (y != null)\n            this.ace.session.setScrollTop(Math.max(0, Math.min(y, maxHeight)));\n        if (x != null)\n            this.ace.session.setScrollLeft(Math.max(0, Math.min(x, config.width)));\n    };\n    this.scrollInfo = function () { return 0; };\n    this.scrollIntoView = function (pos, margin) {\n        if (pos) {\n            var renderer = this.ace.renderer;\n            var viewMargin = { \"top\": 0, \"bottom\": margin };\n            renderer.scrollCursorIntoView(toAcePos(pos), (renderer.lineHeight * 2) / renderer.$size.scrollerHeight, viewMargin);\n        }\n    };\n    this.getLine = function (row) { return this.ace.session.getLine(row); };\n    this.getRange = function (s, e) {\n        return this.ace.session.getTextRange(new Range(s.line, s.ch, e.line, e.ch));\n    };\n    this.replaceRange = function (text, s, e) {\n        if (!e)\n            e = s;\n        var range = new Range(s.line, s.ch, e.line, e.ch);\n        this.ace.session.$clipRangeToDocument(range);\n        return this.ace.session.replace(range, text);\n    };\n    this.replaceSelection =\n        this.replaceSelections = function (p) {\n            var strings = Array.isArray(p) && p;\n            var sel = this.ace.selection;\n            if (this.ace.inVirtualSelectionMode) {\n                this.ace.session.replace(sel.getRange(), strings ? p[0] || \"\" : p);\n                return;\n            }\n            sel.inVirtualSelectionMode = true;\n            var ranges = sel.rangeList.ranges;\n            if (!ranges.length)\n                ranges = [this.ace.multiSelect.getRange()];\n            for (var i = ranges.length; i--;)\n                this.ace.session.replace(ranges[i], strings ? p[i] || \"\" : p);\n            sel.inVirtualSelectionMode = false;\n        };\n    this.getSelection = function () {\n        return this.ace.getSelectedText();\n    };\n    this.getSelections = function () {\n        return this.listSelections().map(function (x) {\n            return this.getRange(x.anchor, x.head);\n        }, this);\n    };\n    this.getInputField = function () {\n        return this.ace.textInput.getElement();\n    };\n    this.getWrapperElement = function () {\n        return this.ace.container;\n    };\n    var optMap = {\n        indentWithTabs: \"useSoftTabs\",\n        indentUnit: \"tabSize\",\n        tabSize: \"tabSize\",\n        firstLineNumber: \"firstLineNumber\",\n        readOnly: \"readOnly\"\n    };\n    this.setOption = function (name, val) {\n        this.state[name] = val;\n        switch (name) {\n            case 'indentWithTabs':\n                name = optMap[name];\n                val = !val;\n                break;\n            case 'keyMap':\n                this.state.$keyMap = val;\n                return;\n                break;\n            default:\n                name = optMap[name];\n        }\n        if (name)\n            this.ace.setOption(name, val);\n    };\n    this.getOption = function (name) {\n        var val;\n        var aceOpt = optMap[name];\n        if (aceOpt)\n            val = this.ace.getOption(aceOpt);\n        switch (name) {\n            case 'indentWithTabs':\n                name = optMap[name];\n                return !val;\n            case 'keyMap':\n                return this.state.$keyMap || 'vim';\n        }\n        return aceOpt ? val : this.state[name];\n    };\n    this.toggleOverwrite = function (on) {\n        this.state.overwrite = on;\n        return this.ace.setOverwrite(on);\n    };\n    this.addOverlay = function (o) {\n        if (!this.$searchHighlight || !this.$searchHighlight.session) {\n            var highlight = new SearchHighlight(null, \"ace_highlight-marker\", \"text\");\n            var marker = this.ace.session.addDynamicMarker(highlight);\n            highlight.id = marker.id;\n            highlight.session = this.ace.session;\n            highlight.destroy = function (o) {\n                highlight.session.off(\"change\", highlight.updateOnChange);\n                highlight.session.off(\"changeEditor\", highlight.destroy);\n                highlight.session.removeMarker(highlight.id);\n                highlight.session = null;\n            };\n            highlight.updateOnChange = function (delta) {\n                var row = delta.start.row;\n                if (row == delta.end.row)\n                    highlight.cache[row] = undefined;\n                else\n                    highlight.cache.splice(row, highlight.cache.length);\n            };\n            highlight.session.on(\"changeEditor\", highlight.destroy);\n            highlight.session.on(\"change\", highlight.updateOnChange);\n        }\n        var re = new RegExp(o.query.source, \"gmi\");\n        this.$searchHighlight = o.highlight = highlight;\n        this.$searchHighlight.setRegexp(re);\n        this.ace.renderer.updateBackMarkers();\n    };\n    this.removeOverlay = function (o) {\n        if (this.$searchHighlight && this.$searchHighlight.session) {\n            this.$searchHighlight.destroy();\n        }\n    };\n    this.getScrollInfo = function () {\n        var renderer = this.ace.renderer;\n        var config = renderer.layerConfig;\n        return {\n            left: renderer.scrollLeft,\n            top: renderer.scrollTop,\n            height: config.maxHeight,\n            width: config.width,\n            clientHeight: config.height,\n            clientWidth: config.width\n        };\n    };\n    this.getValue = function () {\n        return this.ace.getValue();\n    };\n    this.setValue = function (v) {\n        return this.ace.setValue(v, -1);\n    };\n    this.getTokenTypeAt = function (pos) {\n        var token = this.ace.session.getTokenAt(pos.line, pos.ch);\n        return token && /comment|string/.test(token.type) ? \"string\" : \"\";\n    };\n    this.findMatchingBracket = function (pos) {\n        var m = this.ace.session.findMatchingBracket(toAcePos(pos));\n        return { to: m && toCmPos(m) };\n    };\n    this.findMatchingTag = function (pos) {\n        var m = this.ace.session.getMatchingTags(toAcePos(pos));\n        if (!m)\n            return;\n        return {\n            open: {\n                from: toCmPos(m.openTag.start),\n                to: toCmPos(m.openTag.end)\n            },\n            close: {\n                from: toCmPos(m.closeTag.start),\n                to: toCmPos(m.closeTag.end)\n            }\n        };\n    };\n    this.indentLine = function (line, method) {\n        if (method === true)\n            this.ace.session.indentRows(line, line, \"\\t\");\n        else if (method === false)\n            this.ace.session.outdentRows(new Range(line, 0, line, 0));\n    };\n    this.indexFromPos = function (pos) {\n        return this.ace.session.doc.positionToIndex(toAcePos(pos));\n    };\n    this.posFromIndex = function (index) {\n        return toCmPos(this.ace.session.doc.indexToPosition(index));\n    };\n    this.focus = function (index) {\n        return this.ace.textInput.focus();\n    };\n    this.blur = function (index) {\n        return this.ace.blur();\n    };\n    this.defaultTextHeight = function (index) {\n        return this.ace.renderer.layerConfig.lineHeight;\n    };\n    this.scanForBracket = function (pos, dir, _, options) {\n        var re = options.bracketRegex.source;\n        var tokenRe = /paren|text|operator|tag/;\n        if (dir == 1) {\n            var m = this.ace.session.$findClosingBracket(re.slice(1, 2), toAcePos(pos), tokenRe);\n        }\n        else {\n            var m = this.ace.session.$findOpeningBracket(re.slice(-2, -1), { row: pos.line, column: pos.ch + 1 }, tokenRe);\n            if (!m && options.bracketRegex && options.bracketRegex.test(this.getLine(pos.line)[pos.ch - 1])) {\n                m = { row: pos.line, column: pos.ch - 1 };\n            }\n        }\n        return m && { pos: toCmPos(m) };\n    };\n    this.refresh = function () {\n        return this.ace.resize(true);\n    };\n    this.getMode = function () {\n        return { name: this.getOption(\"mode\") };\n    };\n    this.execCommand = function (name) {\n        if (CodeMirror.commands.hasOwnProperty(name))\n            return CodeMirror.commands[name](this);\n        if (name == \"indentAuto\")\n            return this.ace.execCommand(\"autoindent\");\n        console.log(name + \" is not implemented\");\n    };\n    this.getLineNumber = function (handle) {\n        var deltas = this.$lineHandleChanges;\n        if (!deltas)\n            return null;\n        var row = handle.row;\n        for (var i = 0; i < deltas.length; i++) {\n            var delta = deltas[i];\n            if (delta.start.row != delta.end.row) {\n                if (delta.action[0] == \"i\") {\n                    if (delta.start.row < row)\n                        row += delta.end.row - delta.start.row;\n                }\n                else {\n                    if (delta.start.row < row) {\n                        if (row < delta.end.row || row == delta.end.row && delta.start.column > 0) {\n                            return null;\n                        }\n                        row -= delta.end.row - delta.start.row;\n                    }\n                }\n            }\n        }\n        return row;\n    };\n    this.getLineHandle = function (row) {\n        if (!this.$lineHandleChanges)\n            this.$lineHandleChanges = [];\n        return { text: this.ace.session.getLine(row), row: row };\n    };\n    this.releaseLineHandles = function () {\n        this.$lineHandleChanges = undefined;\n    };\n    this.getLastEditEnd = function () {\n        var undoManager = this.ace.session.$undoManager;\n        if (undoManager && undoManager.$lastDelta)\n            return toCmPos(undoManager.$lastDelta.end);\n    };\n}).call(CodeMirror.prototype);\nfunction toAcePos(cmPos) {\n    return { row: cmPos.line, column: cmPos.ch };\n}\nfunction toCmPos(acePos) {\n    return new Pos(acePos.row, acePos.column);\n}\nvar StringStream = CodeMirror.StringStream = function (string, tabSize) {\n    this.pos = this.start = 0;\n    this.string = string;\n    this.tabSize = tabSize || 8;\n    this.lastColumnPos = this.lastColumnValue = 0;\n    this.lineStart = 0;\n};\nStringStream.prototype = {\n    eol: function () { return this.pos >= this.string.length; },\n    sol: function () { return this.pos == this.lineStart; },\n    peek: function () { return this.string.charAt(this.pos) || undefined; },\n    next: function () {\n        if (this.pos < this.string.length)\n            return this.string.charAt(this.pos++);\n    },\n    eat: function (match) {\n        var ch = this.string.charAt(this.pos);\n        if (typeof match == \"string\")\n            var ok = ch == match;\n        else\n            var ok = ch && (match.test ? match.test(ch) : match(ch));\n        if (ok) {\n            ++this.pos;\n            return ch;\n        }\n    },\n    eatWhile: function (match) {\n        var start = this.pos;\n        while (this.eat(match)) { }\n        return this.pos > start;\n    },\n    eatSpace: function () {\n        var start = this.pos;\n        while (/[\\s\\u00a0]/.test(this.string.charAt(this.pos)))\n            ++this.pos;\n        return this.pos > start;\n    },\n    skipToEnd: function () { this.pos = this.string.length; },\n    skipTo: function (ch) {\n        var found = this.string.indexOf(ch, this.pos);\n        if (found > -1) {\n            this.pos = found;\n            return true;\n        }\n    },\n    backUp: function (n) { this.pos -= n; },\n    column: function () {\n        throw \"not implemented\";\n    },\n    indentation: function () {\n        throw \"not implemented\";\n    },\n    match: function (pattern, consume, caseInsensitive) {\n        if (typeof pattern == \"string\") {\n            var cased = function (str) { return caseInsensitive ? str.toLowerCase() : str; };\n            var substr = this.string.substr(this.pos, pattern.length);\n            if (cased(substr) == cased(pattern)) {\n                if (consume !== false)\n                    this.pos += pattern.length;\n                return true;\n            }\n        }\n        else {\n            var match = this.string.slice(this.pos).match(pattern);\n            if (match && match.index > 0)\n                return null;\n            if (match && consume !== false)\n                this.pos += match[0].length;\n            return match;\n        }\n    },\n    current: function () { return this.string.slice(this.start, this.pos); },\n    hideFirstChars: function (n, inner) {\n        this.lineStart += n;\n        try {\n            return inner();\n        }\n        finally {\n            this.lineStart -= n;\n        }\n    }\n};\nCodeMirror.defineExtension = function (name, fn) {\n    CodeMirror.prototype[name] = fn;\n};\ndomLib.importCssString(\".normal-mode .ace_cursor{\\n    border: none;\\n    background-color: rgba(255,0,0,0.5);\\n}\\n.normal-mode .ace_hidden-cursors .ace_cursor{\\n  background-color: transparent;\\n  border: 1px solid red;\\n  opacity: 0.7\\n}\\n.ace_dialog {\\n  position: absolute;\\n  left: 0; right: 0;\\n  background: inherit;\\n  z-index: 15;\\n  padding: .1em .8em;\\n  overflow: hidden;\\n  color: inherit;\\n}\\n.ace_dialog-top {\\n  border-bottom: 1px solid #444;\\n  top: 0;\\n}\\n.ace_dialog-bottom {\\n  border-top: 1px solid #444;\\n  bottom: 0;\\n}\\n.ace_dialog input {\\n  border: none;\\n  outline: none;\\n  background: transparent;\\n  width: 20em;\\n  color: inherit;\\n  font-family: monospace;\\n}\", \"vimMode\", false);\n(function () {\n    function dialogDiv(cm, template, bottom) {\n        var wrap = cm.ace.container;\n        var dialog;\n        dialog = wrap.appendChild(document.createElement(\"div\"));\n        if (bottom)\n            dialog.className = \"ace_dialog ace_dialog-bottom\";\n        else\n            dialog.className = \"ace_dialog ace_dialog-top\";\n        if (typeof template == \"string\") {\n            dialog.innerHTML = template;\n        }\n        else { // Assuming it's a detached DOM element.\n            dialog.appendChild(template);\n        }\n        return dialog;\n    }\n    function closeNotification(cm, newVal) {\n        if (cm.state.currentNotificationClose)\n            cm.state.currentNotificationClose();\n        cm.state.currentNotificationClose = newVal;\n    }\n    CodeMirror.defineExtension(\"openDialog\", function (template, callback, options) {\n        if (this.virtualSelectionMode())\n            return;\n        if (!options)\n            options = {};\n        closeNotification(this, null);\n        var dialog = dialogDiv(this, template, options.bottom);\n        var closed = false, me = this;\n        this.state.dialog = dialog;\n        function close(newVal) {\n            if (typeof newVal == 'string') {\n                inp.value = newVal;\n            }\n            else {\n                if (closed)\n                    return;\n                if (newVal && newVal.type == \"blur\") {\n                    if (document.activeElement === inp)\n                        return;\n                }\n                if (me.state.dialog == dialog) {\n                    me.state.dialog = null;\n                    me.focus();\n                }\n                closed = true;\n                dialog.remove();\n                if (options.onClose)\n                    options.onClose(dialog);\n                var cm = me;\n                if (cm.state.vim) {\n                    cm.state.vim.status = null;\n                    cm.ace._signal(\"changeStatus\");\n                    cm.ace.renderer.$loop.schedule(cm.ace.renderer.CHANGE_CURSOR);\n                }\n            }\n        }\n        var inp = dialog.getElementsByTagName(\"input\")[0], button;\n        if (inp) {\n            if (options.value) {\n                inp.value = options.value;\n                if (options.selectValueOnOpen !== false)\n                    inp.select();\n            }\n            if (options.onInput)\n                CodeMirror.on(inp, \"input\", function (e) { options.onInput(e, inp.value, close); });\n            if (options.onKeyUp)\n                CodeMirror.on(inp, \"keyup\", function (e) { options.onKeyUp(e, inp.value, close); });\n            CodeMirror.on(inp, \"keydown\", function (e) {\n                if (options && options.onKeyDown && options.onKeyDown(e, inp.value, close)) {\n                    return;\n                }\n                if (e.keyCode == 13)\n                    callback(inp.value);\n                if (e.keyCode == 27 || (options.closeOnEnter !== false && e.keyCode == 13)) {\n                    CodeMirror.e_stop(e);\n                    close();\n                }\n            });\n            if (options.closeOnBlur !== false)\n                CodeMirror.on(inp, \"blur\", close);\n            inp.focus();\n        }\n        else if (button = dialog.getElementsByTagName(\"button\")[0]) {\n            CodeMirror.on(button, \"click\", function () {\n                close();\n                me.focus();\n            });\n            if (options.closeOnBlur !== false)\n                CodeMirror.on(button, \"blur\", close);\n            button.focus();\n        }\n        return close;\n    });\n    CodeMirror.defineExtension(\"openNotification\", function (template, options) {\n        if (this.virtualSelectionMode())\n            return;\n        closeNotification(this, close);\n        var dialog = dialogDiv(this, template, options && options.bottom);\n        var closed = false, doneTimer;\n        var duration = options && typeof options.duration !== \"undefined\" ? options.duration : 5000;\n        function close() {\n            if (closed)\n                return;\n            closed = true;\n            clearTimeout(doneTimer);\n            dialog.remove();\n        }\n        CodeMirror.on(dialog, 'click', function (e) {\n            CodeMirror.e_preventDefault(e);\n            close();\n        });\n        if (duration)\n            doneTimer = setTimeout(close, duration);\n        return close;\n    });\n})();\nvar Pos = CodeMirror.Pos;\nfunction updateSelectionForSurrogateCharacters(cm, curStart, curEnd) {\n    if (curStart.line === curEnd.line && curStart.ch >= curEnd.ch - 1) {\n        var text = cm.getLine(curStart.line);\n        var charCode = text.charCodeAt(curStart.ch);\n        if (0xD800 <= charCode && charCode <= 0xD8FF) {\n            curEnd.ch += 1;\n        }\n    }\n    return { start: curStart, end: curEnd };\n}\nvar defaultKeymap = [\n    { keys: '', type: 'keyToKey', toKeys: 'h' },\n    { keys: '', type: 'keyToKey', toKeys: 'l' },\n    { keys: '', type: 'keyToKey', toKeys: 'k' },\n    { keys: '', type: 'keyToKey', toKeys: 'j' },\n    { keys: 'g', type: 'keyToKey', toKeys: 'gk' },\n    { keys: 'g', type: 'keyToKey', toKeys: 'gj' },\n    { keys: '', type: 'keyToKey', toKeys: 'l' },\n    { keys: '', type: 'keyToKey', toKeys: 'h' },\n    { keys: '', type: 'keyToKey', toKeys: 'x' },\n    { keys: '', type: 'keyToKey', toKeys: 'W' },\n    { keys: '', type: 'keyToKey', toKeys: 'B' },\n    { keys: '', type: 'keyToKey', toKeys: 'w' },\n    { keys: '', type: 'keyToKey', toKeys: 'b' },\n    { keys: '', type: 'keyToKey', toKeys: 'j' },\n    { keys: '', type: 'keyToKey', toKeys: 'k' },\n    { keys: '', type: 'keyToKey', toKeys: '' },\n    { keys: '', type: 'keyToKey', toKeys: '' },\n    { keys: '', type: 'keyToKey', toKeys: '', context: 'insert' },\n    { keys: '', type: 'keyToKey', toKeys: '', context: 'insert' },\n    { keys: '', type: 'keyToKey', toKeys: '' }, // ipad keyboard sends C-Esc instead of C-[\n    { keys: '', type: 'keyToKey', toKeys: '', context: 'insert' },\n    { keys: 's', type: 'keyToKey', toKeys: 'cl', context: 'normal' },\n    { keys: 's', type: 'keyToKey', toKeys: 'c', context: 'visual' },\n    { keys: 'S', type: 'keyToKey', toKeys: 'cc', context: 'normal' },\n    { keys: 'S', type: 'keyToKey', toKeys: 'VdO', context: 'visual' },\n    { keys: '', type: 'keyToKey', toKeys: '0' },\n    { keys: '', type: 'keyToKey', toKeys: '$' },\n    { keys: '', type: 'keyToKey', toKeys: '' },\n    { keys: '', type: 'keyToKey', toKeys: '' },\n    { keys: '', type: 'keyToKey', toKeys: 'j^', context: 'normal' },\n    { keys: '', type: 'keyToKey', toKeys: 'i', context: 'normal' },\n    { keys: '', type: 'action', action: 'toggleOverwrite', context: 'insert' },\n    { keys: 'H', type: 'motion', motion: 'moveToTopLine', motionArgs: { linewise: true, toJumplist: true } },\n    { keys: 'M', type: 'motion', motion: 'moveToMiddleLine', motionArgs: { linewise: true, toJumplist: true } },\n    { keys: 'L', type: 'motion', motion: 'moveToBottomLine', motionArgs: { linewise: true, toJumplist: true } },\n    { keys: 'h', type: 'motion', motion: 'moveByCharacters', motionArgs: { forward: false } },\n    { keys: 'l', type: 'motion', motion: 'moveByCharacters', motionArgs: { forward: true } },\n    { keys: 'j', type: 'motion', motion: 'moveByLines', motionArgs: { forward: true, linewise: true } },\n    { keys: 'k', type: 'motion', motion: 'moveByLines', motionArgs: { forward: false, linewise: true } },\n    { keys: 'gj', type: 'motion', motion: 'moveByDisplayLines', motionArgs: { forward: true } },\n    { keys: 'gk', type: 'motion', motion: 'moveByDisplayLines', motionArgs: { forward: false } },\n    { keys: 'w', type: 'motion', motion: 'moveByWords', motionArgs: { forward: true, wordEnd: false } },\n    { keys: 'W', type: 'motion', motion: 'moveByWords', motionArgs: { forward: true, wordEnd: false, bigWord: true } },\n    { keys: 'e', type: 'motion', motion: 'moveByWords', motionArgs: { forward: true, wordEnd: true, inclusive: true } },\n    { keys: 'E', type: 'motion', motion: 'moveByWords', motionArgs: { forward: true, wordEnd: true, bigWord: true, inclusive: true } },\n    { keys: 'b', type: 'motion', motion: 'moveByWords', motionArgs: { forward: false, wordEnd: false } },\n    { keys: 'B', type: 'motion', motion: 'moveByWords', motionArgs: { forward: false, wordEnd: false, bigWord: true } },\n    { keys: 'ge', type: 'motion', motion: 'moveByWords', motionArgs: { forward: false, wordEnd: true, inclusive: true } },\n    { keys: 'gE', type: 'motion', motion: 'moveByWords', motionArgs: { forward: false, wordEnd: true, bigWord: true, inclusive: true } },\n    { keys: '{', type: 'motion', motion: 'moveByParagraph', motionArgs: { forward: false, toJumplist: true } },\n    { keys: '}', type: 'motion', motion: 'moveByParagraph', motionArgs: { forward: true, toJumplist: true } },\n    { keys: '(', type: 'motion', motion: 'moveBySentence', motionArgs: { forward: false } },\n    { keys: ')', type: 'motion', motion: 'moveBySentence', motionArgs: { forward: true } },\n    { keys: '', type: 'motion', motion: 'moveByPage', motionArgs: { forward: true } },\n    { keys: '', type: 'motion', motion: 'moveByPage', motionArgs: { forward: false } },\n    { keys: '', type: 'motion', motion: 'moveByScroll', motionArgs: { forward: true, explicitRepeat: true } },\n    { keys: '', type: 'motion', motion: 'moveByScroll', motionArgs: { forward: false, explicitRepeat: true } },\n    { keys: 'gg', type: 'motion', motion: 'moveToLineOrEdgeOfDocument', motionArgs: { forward: false, explicitRepeat: true, linewise: true, toJumplist: true } },\n    { keys: 'G', type: 'motion', motion: 'moveToLineOrEdgeOfDocument', motionArgs: { forward: true, explicitRepeat: true, linewise: true, toJumplist: true } },\n    { keys: \"g$\", type: \"motion\", motion: \"moveToEndOfDisplayLine\" },\n    { keys: \"g^\", type: \"motion\", motion: \"moveToStartOfDisplayLine\" },\n    { keys: \"g0\", type: \"motion\", motion: \"moveToStartOfDisplayLine\" },\n    { keys: '0', type: 'motion', motion: 'moveToStartOfLine' },\n    { keys: '^', type: 'motion', motion: 'moveToFirstNonWhiteSpaceCharacter' },\n    { keys: '+', type: 'motion', motion: 'moveByLines', motionArgs: { forward: true, toFirstChar: true } },\n    { keys: '-', type: 'motion', motion: 'moveByLines', motionArgs: { forward: false, toFirstChar: true } },\n    { keys: '_', type: 'motion', motion: 'moveByLines', motionArgs: { forward: true, toFirstChar: true, repeatOffset: -1 } },\n    { keys: '$', type: 'motion', motion: 'moveToEol', motionArgs: { inclusive: true } },\n    { keys: '%', type: 'motion', motion: 'moveToMatchedSymbol', motionArgs: { inclusive: true, toJumplist: true } },\n    { keys: 'f', type: 'motion', motion: 'moveToCharacter', motionArgs: { forward: true, inclusive: true } },\n    { keys: 'F', type: 'motion', motion: 'moveToCharacter', motionArgs: { forward: false } },\n    { keys: 't', type: 'motion', motion: 'moveTillCharacter', motionArgs: { forward: true, inclusive: true } },\n    { keys: 'T', type: 'motion', motion: 'moveTillCharacter', motionArgs: { forward: false } },\n    { keys: ';', type: 'motion', motion: 'repeatLastCharacterSearch', motionArgs: { forward: true } },\n    { keys: ',', type: 'motion', motion: 'repeatLastCharacterSearch', motionArgs: { forward: false } },\n    { keys: '\\'', type: 'motion', motion: 'goToMark', motionArgs: { toJumplist: true, linewise: true } },\n    { keys: '`', type: 'motion', motion: 'goToMark', motionArgs: { toJumplist: true } },\n    { keys: ']`', type: 'motion', motion: 'jumpToMark', motionArgs: { forward: true } },\n    { keys: '[`', type: 'motion', motion: 'jumpToMark', motionArgs: { forward: false } },\n    { keys: ']\\'', type: 'motion', motion: 'jumpToMark', motionArgs: { forward: true, linewise: true } },\n    { keys: '[\\'', type: 'motion', motion: 'jumpToMark', motionArgs: { forward: false, linewise: true } },\n    { keys: ']p', type: 'action', action: 'paste', isEdit: true, actionArgs: { after: true, isEdit: true, matchIndent: true } },\n    { keys: '[p', type: 'action', action: 'paste', isEdit: true, actionArgs: { after: false, isEdit: true, matchIndent: true } },\n    { keys: ']', type: 'motion', motion: 'moveToSymbol', motionArgs: { forward: true, toJumplist: true } },\n    { keys: '[', type: 'motion', motion: 'moveToSymbol', motionArgs: { forward: false, toJumplist: true } },\n    { keys: '|', type: 'motion', motion: 'moveToColumn' },\n    { keys: 'o', type: 'motion', motion: 'moveToOtherHighlightedEnd', context: 'visual' },\n    { keys: 'O', type: 'motion', motion: 'moveToOtherHighlightedEnd', motionArgs: { sameLine: true }, context: 'visual' },\n    { keys: 'd', type: 'operator', operator: 'delete' },\n    { keys: 'y', type: 'operator', operator: 'yank' },\n    { keys: 'c', type: 'operator', operator: 'change' },\n    { keys: '=', type: 'operator', operator: 'indentAuto' },\n    { keys: '>', type: 'operator', operator: 'indent', operatorArgs: { indentRight: true } },\n    { keys: '<', type: 'operator', operator: 'indent', operatorArgs: { indentRight: false } },\n    { keys: 'g~', type: 'operator', operator: 'changeCase' },\n    { keys: 'gu', type: 'operator', operator: 'changeCase', operatorArgs: { toLower: true }, isEdit: true },\n    { keys: 'gU', type: 'operator', operator: 'changeCase', operatorArgs: { toLower: false }, isEdit: true },\n    { keys: 'n', type: 'motion', motion: 'findNext', motionArgs: { forward: true, toJumplist: true } },\n    { keys: 'N', type: 'motion', motion: 'findNext', motionArgs: { forward: false, toJumplist: true } },\n    { keys: 'gn', type: 'motion', motion: 'findAndSelectNextInclusive', motionArgs: { forward: true } },\n    { keys: 'gN', type: 'motion', motion: 'findAndSelectNextInclusive', motionArgs: { forward: false } },\n    { keys: 'gq', type: 'operator', operator: 'hardWrap' },\n    { keys: 'gw', type: 'operator', operator: 'hardWrap', operatorArgs: { keepCursor: true } },\n    { keys: 'x', type: 'operatorMotion', operator: 'delete', motion: 'moveByCharacters', motionArgs: { forward: true }, operatorMotionArgs: { visualLine: false } },\n    { keys: 'X', type: 'operatorMotion', operator: 'delete', motion: 'moveByCharacters', motionArgs: { forward: false }, operatorMotionArgs: { visualLine: true } },\n    { keys: 'D', type: 'operatorMotion', operator: 'delete', motion: 'moveToEol', motionArgs: { inclusive: true }, context: 'normal' },\n    { keys: 'D', type: 'operator', operator: 'delete', operatorArgs: { linewise: true }, context: 'visual' },\n    { keys: 'Y', type: 'operatorMotion', operator: 'yank', motion: 'expandToLine', motionArgs: { linewise: true }, context: 'normal' },\n    { keys: 'Y', type: 'operator', operator: 'yank', operatorArgs: { linewise: true }, context: 'visual' },\n    { keys: 'C', type: 'operatorMotion', operator: 'change', motion: 'moveToEol', motionArgs: { inclusive: true }, context: 'normal' },\n    { keys: 'C', type: 'operator', operator: 'change', operatorArgs: { linewise: true }, context: 'visual' },\n    { keys: '~', type: 'operatorMotion', operator: 'changeCase', motion: 'moveByCharacters', motionArgs: { forward: true }, operatorArgs: { shouldMoveCursor: true }, context: 'normal' },\n    { keys: '~', type: 'operator', operator: 'changeCase', context: 'visual' },\n    { keys: '', type: 'operatorMotion', operator: 'delete', motion: 'moveToStartOfLine', context: 'insert' },\n    { keys: '', type: 'operatorMotion', operator: 'delete', motion: 'moveByWords', motionArgs: { forward: false, wordEnd: false }, context: 'insert' },\n    { keys: '', type: 'idle', context: 'normal' },\n    { keys: '', type: 'action', action: 'jumpListWalk', actionArgs: { forward: true } },\n    { keys: '', type: 'action', action: 'jumpListWalk', actionArgs: { forward: false } },\n    { keys: '', type: 'action', action: 'scroll', actionArgs: { forward: true, linewise: true } },\n    { keys: '', type: 'action', action: 'scroll', actionArgs: { forward: false, linewise: true } },\n    { keys: 'a', type: 'action', action: 'enterInsertMode', isEdit: true, actionArgs: { insertAt: 'charAfter' }, context: 'normal' },\n    { keys: 'A', type: 'action', action: 'enterInsertMode', isEdit: true, actionArgs: { insertAt: 'eol' }, context: 'normal' },\n    { keys: 'A', type: 'action', action: 'enterInsertMode', isEdit: true, actionArgs: { insertAt: 'endOfSelectedArea' }, context: 'visual' },\n    { keys: 'i', type: 'action', action: 'enterInsertMode', isEdit: true, actionArgs: { insertAt: 'inplace' }, context: 'normal' },\n    { keys: 'gi', type: 'action', action: 'enterInsertMode', isEdit: true, actionArgs: { insertAt: 'lastEdit' }, context: 'normal' },\n    { keys: 'I', type: 'action', action: 'enterInsertMode', isEdit: true, actionArgs: { insertAt: 'firstNonBlank' }, context: 'normal' },\n    { keys: 'gI', type: 'action', action: 'enterInsertMode', isEdit: true, actionArgs: { insertAt: 'bol' }, context: 'normal' },\n    { keys: 'I', type: 'action', action: 'enterInsertMode', isEdit: true, actionArgs: { insertAt: 'startOfSelectedArea' }, context: 'visual' },\n    { keys: 'o', type: 'action', action: 'newLineAndEnterInsertMode', isEdit: true, interlaceInsertRepeat: true, actionArgs: { after: true }, context: 'normal' },\n    { keys: 'O', type: 'action', action: 'newLineAndEnterInsertMode', isEdit: true, interlaceInsertRepeat: true, actionArgs: { after: false }, context: 'normal' },\n    { keys: 'v', type: 'action', action: 'toggleVisualMode' },\n    { keys: 'V', type: 'action', action: 'toggleVisualMode', actionArgs: { linewise: true } },\n    { keys: '', type: 'action', action: 'toggleVisualMode', actionArgs: { blockwise: true } },\n    { keys: '', type: 'action', action: 'toggleVisualMode', actionArgs: { blockwise: true } },\n    { keys: 'gv', type: 'action', action: 'reselectLastSelection' },\n    { keys: 'J', type: 'action', action: 'joinLines', isEdit: true },\n    { keys: 'gJ', type: 'action', action: 'joinLines', actionArgs: { keepSpaces: true }, isEdit: true },\n    { keys: 'p', type: 'action', action: 'paste', isEdit: true, actionArgs: { after: true, isEdit: true } },\n    { keys: 'P', type: 'action', action: 'paste', isEdit: true, actionArgs: { after: false, isEdit: true } },\n    { keys: 'r', type: 'action', action: 'replace', isEdit: true },\n    { keys: '@', type: 'action', action: 'replayMacro' },\n    { keys: 'q', type: 'action', action: 'enterMacroRecordMode' },\n    { keys: 'R', type: 'action', action: 'enterInsertMode', isEdit: true, actionArgs: { replace: true }, context: 'normal' },\n    { keys: 'R', type: 'operator', operator: 'change', operatorArgs: { linewise: true, fullLine: true }, context: 'visual', exitVisualBlock: true },\n    { keys: 'u', type: 'action', action: 'undo', context: 'normal' },\n    { keys: 'u', type: 'operator', operator: 'changeCase', operatorArgs: { toLower: true }, context: 'visual', isEdit: true },\n    { keys: 'U', type: 'operator', operator: 'changeCase', operatorArgs: { toLower: false }, context: 'visual', isEdit: true },\n    { keys: '', type: 'action', action: 'redo' },\n    { keys: 'm', type: 'action', action: 'setMark' },\n    { keys: '\"', type: 'action', action: 'setRegister' },\n    { keys: '', type: 'action', action: 'insertRegister', context: 'insert', isEdit: true },\n    { keys: '', type: 'action', action: 'oneNormalCommand', context: 'insert' },\n    { keys: 'zz', type: 'action', action: 'scrollToCursor', actionArgs: { position: 'center' } },\n    { keys: 'z.', type: 'action', action: 'scrollToCursor', actionArgs: { position: 'center' }, motion: 'moveToFirstNonWhiteSpaceCharacter' },\n    { keys: 'zt', type: 'action', action: 'scrollToCursor', actionArgs: { position: 'top' } },\n    { keys: 'z', type: 'action', action: 'scrollToCursor', actionArgs: { position: 'top' }, motion: 'moveToFirstNonWhiteSpaceCharacter' },\n    { keys: 'zb', type: 'action', action: 'scrollToCursor', actionArgs: { position: 'bottom' } },\n    { keys: 'z-', type: 'action', action: 'scrollToCursor', actionArgs: { position: 'bottom' }, motion: 'moveToFirstNonWhiteSpaceCharacter' },\n    { keys: '.', type: 'action', action: 'repeatLastEdit' },\n    { keys: '', type: 'action', action: 'incrementNumberToken', isEdit: true, actionArgs: { increase: true, backtrack: false } },\n    { keys: '', type: 'action', action: 'incrementNumberToken', isEdit: true, actionArgs: { increase: false, backtrack: false } },\n    { keys: '', type: 'action', action: 'indent', actionArgs: { indentRight: true }, context: 'insert' },\n    { keys: '', type: 'action', action: 'indent', actionArgs: { indentRight: false }, context: 'insert' },\n    { keys: 'a', type: 'motion', motion: 'textObjectManipulation' },\n    { keys: 'i', type: 'motion', motion: 'textObjectManipulation', motionArgs: { textObjectInner: true } },\n    { keys: '/', type: 'search', searchArgs: { forward: true, querySrc: 'prompt', toJumplist: true } },\n    { keys: '?', type: 'search', searchArgs: { forward: false, querySrc: 'prompt', toJumplist: true } },\n    { keys: '*', type: 'search', searchArgs: { forward: true, querySrc: 'wordUnderCursor', wholeWordOnly: true, toJumplist: true } },\n    { keys: '#', type: 'search', searchArgs: { forward: false, querySrc: 'wordUnderCursor', wholeWordOnly: true, toJumplist: true } },\n    { keys: 'g*', type: 'search', searchArgs: { forward: true, querySrc: 'wordUnderCursor', toJumplist: true } },\n    { keys: 'g#', type: 'search', searchArgs: { forward: false, querySrc: 'wordUnderCursor', toJumplist: true } },\n    { keys: ':', type: 'ex' }\n];\nvar defaultKeymapLength = defaultKeymap.length;\nvar defaultExCommandMap = [\n    { name: 'colorscheme', shortName: 'colo' },\n    { name: 'map' },\n    { name: 'imap', shortName: 'im' },\n    { name: 'nmap', shortName: 'nm' },\n    { name: 'vmap', shortName: 'vm' },\n    { name: 'omap', shortName: 'om' },\n    { name: 'noremap', shortName: 'no' },\n    { name: 'nnoremap', shortName: 'nn' },\n    { name: 'vnoremap', shortName: 'vn' },\n    { name: 'inoremap', shortName: 'ino' },\n    { name: 'onoremap', shortName: 'ono' },\n    { name: 'unmap' },\n    { name: 'mapclear', shortName: 'mapc' },\n    { name: 'nmapclear', shortName: 'nmapc' },\n    { name: 'vmapclear', shortName: 'vmapc' },\n    { name: 'imapclear', shortName: 'imapc' },\n    { name: 'omapclear', shortName: 'omapc' },\n    { name: 'write', shortName: 'w' },\n    { name: 'undo', shortName: 'u' },\n    { name: 'redo', shortName: 'red' },\n    { name: 'set', shortName: 'se' },\n    { name: 'setlocal', shortName: 'setl' },\n    { name: 'setglobal', shortName: 'setg' },\n    { name: 'sort', shortName: 'sor' },\n    { name: 'substitute', shortName: 's', possiblyAsync: true },\n    { name: 'startinsert', shortName: 'start' },\n    { name: 'nohlsearch', shortName: 'noh' },\n    { name: 'yank', shortName: 'y' },\n    { name: 'delmarks', shortName: 'delm' },\n    { name: 'registers', shortName: 'reg', excludeFromCommandHistory: true },\n    { name: 'vglobal', shortName: 'v' },\n    { name: 'delete', shortName: 'd' },\n    { name: 'join', shortName: 'j' },\n    { name: 'normal', shortName: 'norm' },\n    { name: 'global', shortName: 'g' }\n];\nvar langmap = parseLangmap('');\nfunction enterVimMode(cm) {\n    cm.setOption('disableInput', true);\n    cm.setOption('showCursorWhenSelecting', false);\n    CodeMirror.signal(cm, \"vim-mode-change\", { mode: \"normal\" });\n    cm.on('cursorActivity', onCursorActivity);\n    maybeInitVimState(cm);\n    CodeMirror.on(cm.getInputField(), 'paste', getOnPasteFn(cm));\n}\nfunction leaveVimMode(cm) {\n    cm.setOption('disableInput', false);\n    cm.off('cursorActivity', onCursorActivity);\n    CodeMirror.off(cm.getInputField(), 'paste', getOnPasteFn(cm));\n    cm.state.vim = null;\n    if (highlightTimeout)\n        clearTimeout(highlightTimeout);\n}\nfunction getOnPasteFn(cm) {\n    var vim = cm.state.vim;\n    if (!vim.onPasteFn) {\n        vim.onPasteFn = function () {\n            if (!vim.insertMode) {\n                cm.setCursor(offsetCursor(cm.getCursor(), 0, 1));\n                actions.enterInsertMode(cm, {}, vim);\n            }\n        };\n    }\n    return vim.onPasteFn;\n}\nvar numberRegex = /[\\d]/;\nvar wordCharTest = [CodeMirror.isWordChar, function (ch) {\n        return ch && !CodeMirror.isWordChar(ch) && !/\\s/.test(ch);\n    }], bigWordCharTest = [function (ch) {\n        return /\\S/.test(ch);\n    }];\nvar validMarks = ['<', '>'];\nvar validRegisters = ['-', '\"', '.', ':', '_', '/', '+'];\nvar latinCharRegex = /^\\w$/;\nvar upperCaseChars;\ntry {\n    upperCaseChars = new RegExp(\"^[\\\\p{Lu}]$\", \"u\");\n}\ncatch (_) {\n    upperCaseChars = /^[A-Z]$/;\n}\nfunction isLine(cm, line) {\n    return line >= cm.firstLine() && line <= cm.lastLine();\n}\nfunction isLowerCase(k) {\n    return (/^[a-z]$/).test(k);\n}\nfunction isMatchableSymbol(k) {\n    return '()[]{}'.indexOf(k) != -1;\n}\nfunction isNumber(k) {\n    return numberRegex.test(k);\n}\nfunction isUpperCase(k) {\n    return upperCaseChars.test(k);\n}\nfunction isWhiteSpaceString(k) {\n    return (/^\\s*$/).test(k);\n}\nfunction isEndOfSentenceSymbol(k) {\n    return '.?!'.indexOf(k) != -1;\n}\nfunction inArray(val, arr) {\n    for (var i = 0; i < arr.length; i++) {\n        if (arr[i] == val) {\n            return true;\n        }\n    }\n    return false;\n}\nvar options = {};\nfunction defineOption(name, defaultValue, type, aliases, callback) {\n    if (defaultValue === undefined && !callback) {\n        throw Error('defaultValue is required unless callback is provided');\n    }\n    if (!type) {\n        type = 'string';\n    }\n    options[name] = {\n        type: type,\n        defaultValue: defaultValue,\n        callback: callback\n    };\n    if (aliases) {\n        for (var i = 0; i < aliases.length; i++) {\n            options[aliases[i]] = options[name];\n        }\n    }\n    if (defaultValue) {\n        setOption(name, defaultValue);\n    }\n}\nfunction setOption(name, value, cm, cfg) {\n    var option = options[name];\n    cfg = cfg || {};\n    var scope = cfg.scope;\n    if (!option) {\n        return new Error('Unknown option: ' + name);\n    }\n    if (option.type == 'boolean') {\n        if (value && value !== true) {\n            return new Error('Invalid argument: ' + name + '=' + value);\n        }\n        else if (value !== false) {\n            value = true;\n        }\n    }\n    if (option.callback) {\n        if (scope !== 'local') {\n            option.callback(value, undefined);\n        }\n        if (scope !== 'global' && cm) {\n            option.callback(value, cm);\n        }\n    }\n    else {\n        if (scope !== 'local') {\n            option.value = option.type == 'boolean' ? !!value : value;\n        }\n        if (scope !== 'global' && cm) {\n            cm.state.vim.options[name] = { value: value };\n        }\n    }\n}\nfunction getOption(name, cm, cfg) {\n    var option = options[name];\n    cfg = cfg || {};\n    var scope = cfg.scope;\n    if (!option) {\n        return new Error('Unknown option: ' + name);\n    }\n    if (option.callback) {\n        var local = cm && option.callback(undefined, cm);\n        if (scope !== 'global' && local !== undefined) {\n            return local;\n        }\n        if (scope !== 'local') {\n            return option.callback();\n        }\n        return;\n    }\n    else {\n        var local = (scope !== 'global') && (cm && cm.state.vim.options[name]);\n        return (local || (scope !== 'local') && option || {}).value;\n    }\n}\ndefineOption('filetype', undefined, 'string', ['ft'], function (name, cm) {\n    if (cm === undefined) {\n        return;\n    }\n    if (name === undefined) {\n        var mode = cm.getOption('mode');\n        return mode == 'null' ? '' : mode;\n    }\n    else {\n        var mode = name == '' ? 'null' : name;\n        cm.setOption('mode', mode);\n    }\n});\ndefineOption('textwidth', 80, 'number', ['tw'], function (width, cm) {\n    if (cm === undefined) {\n        return;\n    }\n    if (width === undefined) {\n        var value = cm.getOption('textwidth');\n        return value;\n    }\n    else {\n        var column = Math.round(width);\n        if (column > 1) {\n            cm.setOption('textwidth', column);\n        }\n    }\n});\nvar createCircularJumpList = function () {\n    var size = 100;\n    var pointer = -1;\n    var head = 0;\n    var tail = 0;\n    var buffer = new Array(size);\n    function add(cm, oldCur, newCur) {\n        var current = pointer % size;\n        var curMark = buffer[current];\n        function useNextSlot(cursor) {\n            var next = ++pointer % size;\n            var trashMark = buffer[next];\n            if (trashMark) {\n                trashMark.clear();\n            }\n            buffer[next] = cm.setBookmark(cursor);\n        }\n        if (curMark) {\n            var markPos = curMark.find();\n            if (markPos && !cursorEqual(markPos, oldCur)) {\n                useNextSlot(oldCur);\n            }\n        }\n        else {\n            useNextSlot(oldCur);\n        }\n        useNextSlot(newCur);\n        head = pointer;\n        tail = pointer - size + 1;\n        if (tail < 0) {\n            tail = 0;\n        }\n    }\n    function move(cm, offset) {\n        pointer += offset;\n        if (pointer > head) {\n            pointer = head;\n        }\n        else if (pointer < tail) {\n            pointer = tail;\n        }\n        var mark = buffer[(size + pointer) % size];\n        if (mark && !mark.find()) {\n            var inc = offset > 0 ? 1 : -1;\n            var newCur;\n            var oldCur = cm.getCursor();\n            do {\n                pointer += inc;\n                mark = buffer[(size + pointer) % size];\n                if (mark &&\n                    (newCur = mark.find()) &&\n                    !cursorEqual(oldCur, newCur)) {\n                    break;\n                }\n            } while (pointer < head && pointer > tail);\n        }\n        return mark;\n    }\n    function find(cm, offset) {\n        var oldPointer = pointer;\n        var mark = move(cm, offset);\n        pointer = oldPointer;\n        return mark && mark.find();\n    }\n    return {\n        cachedCursor: undefined, //used for # and * jumps\n        add: add,\n        find: find,\n        move: move\n    };\n};\nvar createInsertModeChanges = function (c) {\n    if (c) {\n        return {\n            changes: c.changes,\n            expectCursorActivityForChange: c.expectCursorActivityForChange\n        };\n    }\n    return {\n        changes: [],\n        expectCursorActivityForChange: false\n    };\n};\nfunction MacroModeState() {\n    this.latestRegister = undefined;\n    this.isPlaying = false;\n    this.isRecording = false;\n    this.replaySearchQueries = [];\n    this.onRecordingDone = undefined;\n    this.lastInsertModeChanges = createInsertModeChanges();\n}\nMacroModeState.prototype = {\n    exitMacroRecordMode: function () {\n        var macroModeState = vimGlobalState.macroModeState;\n        if (macroModeState.onRecordingDone) {\n            macroModeState.onRecordingDone(); // close dialog\n        }\n        macroModeState.onRecordingDone = undefined;\n        macroModeState.isRecording = false;\n    },\n    enterMacroRecordMode: function (cm, registerName) {\n        var register = vimGlobalState.registerController.getRegister(registerName);\n        if (register) {\n            register.clear();\n            this.latestRegister = registerName;\n            if (cm.openDialog) {\n                var template = dom('span', { class: 'cm-vim-message' }, 'recording @' + registerName);\n                this.onRecordingDone = cm.openDialog(template, null, { bottom: true });\n            }\n            this.isRecording = true;\n        }\n    }\n};\nfunction maybeInitVimState(cm) {\n    if (!cm.state.vim) {\n        cm.state.vim = {\n            inputState: new InputState(),\n            lastEditInputState: undefined,\n            lastEditActionCommand: undefined,\n            lastHPos: -1,\n            lastHSPos: -1,\n            lastMotion: null,\n            marks: {},\n            insertMode: false,\n            insertModeReturn: false,\n            insertModeRepeat: undefined,\n            visualMode: false,\n            visualLine: false,\n            visualBlock: false,\n            lastSelection: null,\n            lastPastedText: null,\n            sel: {},\n            options: {},\n            expectLiteralNext: false\n        };\n    }\n    return cm.state.vim;\n}\nvar vimGlobalState;\nfunction resetVimGlobalState() {\n    vimGlobalState = {\n        searchQuery: null,\n        searchIsReversed: false,\n        lastSubstituteReplacePart: undefined,\n        jumpList: createCircularJumpList(),\n        macroModeState: new MacroModeState,\n        lastCharacterSearch: { increment: 0, forward: true, selectedCharacter: '' },\n        registerController: new RegisterController({}),\n        searchHistoryController: new HistoryController(),\n        exCommandHistoryController: new HistoryController()\n    };\n    for (var optionName in options) {\n        var option = options[optionName];\n        option.value = option.defaultValue;\n    }\n}\nvar lastInsertModeKeyTimer;\nvar vimApi = {\n    enterVimMode: enterVimMode,\n    leaveVimMode: leaveVimMode,\n    buildKeyMap: function () {\n    },\n    getRegisterController: function () {\n        return vimGlobalState.registerController;\n    },\n    resetVimGlobalState_: resetVimGlobalState,\n    getVimGlobalState_: function () {\n        return vimGlobalState;\n    },\n    maybeInitVimState_: maybeInitVimState,\n    suppressErrorLogging: false,\n    InsertModeKey: InsertModeKey,\n    map: function (lhs, rhs, ctx) {\n        exCommandDispatcher.map(lhs, rhs, ctx);\n    },\n    unmap: function (lhs, ctx) {\n        return exCommandDispatcher.unmap(lhs, ctx);\n    },\n    noremap: function (lhs, rhs, ctx) {\n        exCommandDispatcher.map(lhs, rhs, ctx, true);\n    },\n    mapclear: function (ctx) {\n        var actualLength = defaultKeymap.length, origLength = defaultKeymapLength;\n        var userKeymap = defaultKeymap.slice(0, actualLength - origLength);\n        defaultKeymap = defaultKeymap.slice(actualLength - origLength);\n        if (ctx) {\n            for (var i = userKeymap.length - 1; i >= 0; i--) {\n                var mapping = userKeymap[i];\n                if (ctx !== mapping.context) {\n                    if (mapping.context) {\n                        this._mapCommand(mapping);\n                    }\n                    else {\n                        var contexts = ['normal', 'insert', 'visual'];\n                        for (var j in contexts) {\n                            if (contexts[j] !== ctx) {\n                                var newMapping = {};\n                                for (var key in mapping) {\n                                    newMapping[key] = mapping[key];\n                                }\n                                newMapping.context = contexts[j];\n                                this._mapCommand(newMapping);\n                            }\n                        }\n                    }\n                }\n            }\n        }\n    },\n    langmap: updateLangmap,\n    vimKeyFromEvent: vimKeyFromEvent,\n    setOption: setOption,\n    getOption: getOption,\n    defineOption: defineOption,\n    defineEx: function (name, prefix, func) {\n        if (!prefix) {\n            prefix = name;\n        }\n        else if (name.indexOf(prefix) !== 0) {\n            throw new Error('(Vim.defineEx) \"' + prefix + '\" is not a prefix of \"' + name + '\", command not registered');\n        }\n        exCommands[name] = func;\n        exCommandDispatcher.commandMap_[prefix] = { name: name, shortName: prefix, type: 'api' };\n    },\n    handleKey: function (cm, key, origin) {\n        var command = this.findKey(cm, key, origin);\n        if (typeof command === 'function') {\n            return command();\n        }\n    },\n    multiSelectHandleKey: multiSelectHandleKey,\n    findKey: function (cm, key, origin) {\n        var vim = maybeInitVimState(cm);\n        function handleMacroRecording() {\n            var macroModeState = vimGlobalState.macroModeState;\n            if (macroModeState.isRecording) {\n                if (key == 'q') {\n                    macroModeState.exitMacroRecordMode();\n                    clearInputState(cm);\n                    return true;\n                }\n                if (origin != 'mapping') {\n                    logKey(macroModeState, key);\n                }\n            }\n        }\n        function handleEsc() {\n            if (key == '') {\n                if (vim.visualMode) {\n                    exitVisualMode(cm);\n                }\n                else if (vim.insertMode) {\n                    exitInsertMode(cm);\n                }\n                else {\n                    return;\n                }\n                clearInputState(cm);\n                return true;\n            }\n        }\n        function handleKeyInsertMode() {\n            if (handleEsc()) {\n                return true;\n            }\n            vim.inputState.keyBuffer.push(key);\n            var keys = vim.inputState.keyBuffer.join(\"\");\n            var keysAreChars = key.length == 1;\n            var match = commandDispatcher.matchCommand(keys, defaultKeymap, vim.inputState, 'insert');\n            var changeQueue = vim.inputState.changeQueue;\n            if (match.type == 'none') {\n                clearInputState(cm);\n                return false;\n            }\n            else if (match.type == 'partial') {\n                if (match.expectLiteralNext)\n                    vim.expectLiteralNext = true;\n                if (lastInsertModeKeyTimer) {\n                    window.clearTimeout(lastInsertModeKeyTimer);\n                }\n                lastInsertModeKeyTimer = keysAreChars && window.setTimeout(function () { if (vim.insertMode && vim.inputState.keyBuffer.length) {\n                    clearInputState(cm);\n                } }, getOption('insertModeEscKeysTimeout'));\n                if (keysAreChars) {\n                    var selections = cm.listSelections();\n                    if (!changeQueue || changeQueue.removed.length != selections.length)\n                        changeQueue = vim.inputState.changeQueue = new ChangeQueue;\n                    changeQueue.inserted += key;\n                    for (var i = 0; i < selections.length; i++) {\n                        var from = cursorMin(selections[i].anchor, selections[i].head);\n                        var to = cursorMax(selections[i].anchor, selections[i].head);\n                        var text = cm.getRange(from, cm.state.overwrite ? offsetCursor(to, 0, 1) : to);\n                        changeQueue.removed[i] = (changeQueue.removed[i] || \"\") + text;\n                    }\n                }\n                return !keysAreChars;\n            }\n            vim.expectLiteralNext = false;\n            if (lastInsertModeKeyTimer) {\n                window.clearTimeout(lastInsertModeKeyTimer);\n            }\n            if (match.command && changeQueue) {\n                var selections = cm.listSelections();\n                for (var i = 0; i < selections.length; i++) {\n                    var here = selections[i].head;\n                    cm.replaceRange(changeQueue.removed[i] || \"\", offsetCursor(here, 0, -changeQueue.inserted.length), here, '+input');\n                }\n                vimGlobalState.macroModeState.lastInsertModeChanges.changes.pop();\n            }\n            if (!match.command)\n                clearInputState(cm);\n            return match.command;\n        }\n        function handleKeyNonInsertMode() {\n            if (handleMacroRecording() || handleEsc()) {\n                return true;\n            }\n            vim.inputState.keyBuffer.push(key);\n            var keys = vim.inputState.keyBuffer.join(\"\");\n            if (/^[1-9]\\d*$/.test(keys)) {\n                return true;\n            }\n            var keysMatcher = /^(\\d*)(.*)$/.exec(keys);\n            if (!keysMatcher) {\n                clearInputState(cm);\n                return false;\n            }\n            var context = vim.visualMode ? 'visual' :\n                'normal';\n            var mainKey = keysMatcher[2] || keysMatcher[1];\n            if (vim.inputState.operatorShortcut && vim.inputState.operatorShortcut.slice(-1) == mainKey) {\n                mainKey = vim.inputState.operatorShortcut;\n            }\n            var match = commandDispatcher.matchCommand(mainKey, defaultKeymap, vim.inputState, context);\n            if (match.type == 'none') {\n                clearInputState(cm);\n                return false;\n            }\n            else if (match.type == 'partial') {\n                if (match.expectLiteralNext)\n                    vim.expectLiteralNext = true;\n                return true;\n            }\n            else if (match.type == 'clear') {\n                clearInputState(cm);\n                return true;\n            }\n            vim.expectLiteralNext = false;\n            vim.inputState.keyBuffer.length = 0;\n            keysMatcher = /^(\\d*)(.*)$/.exec(keys);\n            if (keysMatcher[1] && keysMatcher[1] != '0') {\n                vim.inputState.pushRepeatDigit(keysMatcher[1]);\n            }\n            return match.command;\n        }\n        var command;\n        if (vim.insertMode) {\n            command = handleKeyInsertMode();\n        }\n        else {\n            command = handleKeyNonInsertMode();\n        }\n        if (command === false) {\n            return !vim.insertMode && key.length === 1 ? function () { return true; } : undefined;\n        }\n        else if (command === true) {\n            return function () { return true; };\n        }\n        else {\n            return function () {\n                if ((command.operator || command.isEdit) && cm.getOption('readOnly'))\n                    return; // ace_patch\n                return cm.operation(function () {\n                    cm.curOp.isVimOp = true;\n                    try {\n                        if (command.type == 'keyToKey') {\n                            doKeyToKey(cm, command.toKeys, command);\n                        }\n                        else {\n                            commandDispatcher.processCommand(cm, vim, command);\n                        }\n                    }\n                    catch (e) {\n                        cm.state.vim = undefined;\n                        maybeInitVimState(cm);\n                        if (!vimApi.suppressErrorLogging) {\n                            console['log'](e);\n                        }\n                        throw e;\n                    }\n                    return true;\n                });\n            };\n        }\n    },\n    handleEx: function (cm, input) {\n        exCommandDispatcher.processCommand(cm, input);\n    },\n    defineMotion: defineMotion,\n    defineAction: defineAction,\n    defineOperator: defineOperator,\n    mapCommand: mapCommand,\n    _mapCommand: _mapCommand,\n    defineRegister: defineRegister,\n    exitVisualMode: exitVisualMode,\n    exitInsertMode: exitInsertMode\n};\nvar keyToKeyStack = [];\nvar noremap = false;\nvar virtualPrompt;\nfunction sendKeyToPrompt(key) {\n    if (key[0] == \"<\") {\n        var lowerKey = key.toLowerCase().slice(1, -1);\n        var parts = lowerKey.split('-');\n        lowerKey = parts.pop() || '';\n        if (lowerKey == 'lt')\n            key = '<';\n        else if (lowerKey == 'space')\n            key = ' ';\n        else if (lowerKey == 'cr')\n            key = '\\n';\n        else if (vimToCmKeyMap[lowerKey]) {\n            var value = virtualPrompt.value;\n            var event = {\n                key: vimToCmKeyMap[lowerKey],\n                target: {\n                    value: value,\n                    selectionEnd: value.length,\n                    selectionStart: value.length\n                }\n            };\n            if (virtualPrompt.onKeyDown) {\n                virtualPrompt.onKeyDown(event, virtualPrompt.value, close);\n            }\n            if (virtualPrompt && virtualPrompt.onKeyUp) {\n                virtualPrompt.onKeyUp(event, virtualPrompt.value, close);\n            }\n            return;\n        }\n    }\n    if (key == '\\n') {\n        var prompt = virtualPrompt;\n        virtualPrompt = null;\n        prompt.onClose && prompt.onClose(prompt.value);\n    }\n    else {\n        virtualPrompt.value = (virtualPrompt.value || '') + key;\n    }\n    function close(value) {\n        if (typeof value == 'string') {\n            virtualPrompt.value = value;\n        }\n        else {\n            virtualPrompt = null;\n        }\n    }\n}\nfunction doKeyToKey(cm, keys, fromKey) {\n    var noremapBefore = noremap;\n    if (fromKey) {\n        if (keyToKeyStack.indexOf(fromKey) != -1)\n            return;\n        keyToKeyStack.push(fromKey);\n        noremap = fromKey.noremap != false;\n    }\n    try {\n        var vim = maybeInitVimState(cm);\n        var keyRe = /<(?:[CSMA]-)*\\w+>|./gi;\n        var match;\n        while ((match = keyRe.exec(keys))) {\n            var key = match[0];\n            var wasInsert = vim.insertMode;\n            if (virtualPrompt) {\n                sendKeyToPrompt(key);\n                continue;\n            }\n            var result = vimApi.handleKey(cm, key, 'mapping');\n            if (!result && wasInsert && vim.insertMode) {\n                if (key[0] == \"<\") {\n                    var lowerKey = key.toLowerCase().slice(1, -1);\n                    var parts = lowerKey.split('-');\n                    lowerKey = parts.pop() || '';\n                    if (lowerKey == 'lt')\n                        key = '<';\n                    else if (lowerKey == 'space')\n                        key = ' ';\n                    else if (lowerKey == 'cr')\n                        key = '\\n';\n                    else if (vimToCmKeyMap.hasOwnProperty(lowerKey)) {\n                        key = vimToCmKeyMap[lowerKey];\n                        sendCmKey(cm, key);\n                        continue;\n                    }\n                    else {\n                        key = key[0];\n                        keyRe.lastIndex = match.index + 1;\n                    }\n                }\n                cm.replaceSelection(key);\n            }\n        }\n    }\n    finally {\n        keyToKeyStack.pop();\n        noremap = keyToKeyStack.length ? noremapBefore : false;\n        if (!keyToKeyStack.length && virtualPrompt) {\n            var promptOptions = virtualPrompt;\n            virtualPrompt = null;\n            showPrompt(cm, promptOptions);\n        }\n    }\n}\nvar specialKey = {\n    Return: 'CR', Backspace: 'BS', 'Delete': 'Del', Escape: 'Esc', Insert: 'Ins',\n    ArrowLeft: 'Left', ArrowRight: 'Right', ArrowUp: 'Up', ArrowDown: 'Down',\n    Enter: 'CR', ' ': 'Space'\n};\nvar ignoredKeys = { Shift: 1, Alt: 1, Command: 1, Control: 1,\n    CapsLock: 1, AltGraph: 1, Dead: 1, Unidentified: 1 };\nvar vimToCmKeyMap = {};\n'Left|Right|Up|Down|End|Home'.split('|').concat(Object.keys(specialKey)).forEach(function (x) {\n    vimToCmKeyMap[(specialKey[x] || '').toLowerCase()]\n        = vimToCmKeyMap[x.toLowerCase()] = x;\n});\nfunction vimKeyFromEvent(e, vim) {\n    var key = e.key;\n    if (ignoredKeys[key])\n        return;\n    if (key.length > 1 && key[0] == \"n\") {\n        key = key.replace(\"Numpad\", \"\");\n    }\n    key = specialKey[key] || key;\n    var name = '';\n    if (e.ctrlKey) {\n        name += 'C-';\n    }\n    if (e.altKey) {\n        name += 'A-';\n    }\n    if (e.metaKey) {\n        name += 'M-';\n    }\n    if (CodeMirror.isMac && e.altKey && !e.metaKey && !e.ctrlKey) {\n        name = name.slice(2);\n    }\n    if ((name || key.length > 1) && e.shiftKey) {\n        name += 'S-';\n    }\n    if (vim && !vim.expectLiteralNext && key.length == 1) {\n        if (langmap.keymap && key in langmap.keymap) {\n            if (langmap.remapCtrl != false || !name)\n                key = langmap.keymap[key];\n        }\n        else if (key.charCodeAt(0) > 255) {\n            var code = e.code && e.code.slice(-1) || \"\";\n            if (!e.shiftKey)\n                code = code.toLowerCase();\n            if (code)\n                key = code;\n        }\n    }\n    name += key;\n    if (name.length > 1) {\n        name = '<' + name + '>';\n    }\n    return name;\n}\n;\nfunction updateLangmap(langmapString, remapCtrl) {\n    if (langmap.string !== langmapString) {\n        langmap = parseLangmap(langmapString);\n    }\n    langmap.remapCtrl = remapCtrl;\n}\nfunction parseLangmap(langmapString) {\n    var keymap = {};\n    if (!langmapString)\n        return { keymap: keymap, string: '' };\n    function getEscaped(list) {\n        return list.split(/\\\\?(.)/).filter(Boolean);\n    }\n    langmapString.split(/((?:[^\\\\,]|\\\\.)+),/).map(function (part) {\n        if (!part)\n            return;\n        var semicolon = part.split(/((?:[^\\\\;]|\\\\.)+);/);\n        if (semicolon.length == 3) {\n            var from = getEscaped(semicolon[1]);\n            var to = getEscaped(semicolon[2]);\n            if (from.length !== to.length)\n                return; // skip over malformed part\n            for (var i = 0; i < from.length; ++i)\n                keymap[from[i]] = to[i];\n        }\n        else if (semicolon.length == 1) {\n            var pairs = getEscaped(part);\n            if (pairs.length % 2 !== 0)\n                return; // skip over malformed part\n            for (var i = 0; i < pairs.length; i += 2)\n                keymap[pairs[i]] = pairs[i + 1];\n        }\n    });\n    return { keymap: keymap, string: langmapString };\n}\ndefineOption('langmap', undefined, 'string', ['lmap'], function (name, cm) {\n    if (name === undefined) {\n        return langmap.string;\n    }\n    else {\n        updateLangmap(name);\n    }\n});\nfunction InputState() {\n    this.prefixRepeat = [];\n    this.motionRepeat = [];\n    this.operator = null;\n    this.operatorArgs = null;\n    this.motion = null;\n    this.motionArgs = null;\n    this.keyBuffer = []; // For matching multi-key commands.\n    this.registerName = null; // Defaults to the unnamed register.\n    this.changeQueue = null; // For restoring text used by insert mode keybindings\n}\nInputState.prototype.pushRepeatDigit = function (n) {\n    if (!this.operator) {\n        this.prefixRepeat = this.prefixRepeat.concat(n);\n    }\n    else {\n        this.motionRepeat = this.motionRepeat.concat(n);\n    }\n};\nInputState.prototype.getRepeat = function () {\n    var repeat = 0;\n    if (this.prefixRepeat.length > 0 || this.motionRepeat.length > 0) {\n        repeat = 1;\n        if (this.prefixRepeat.length > 0) {\n            repeat *= parseInt(this.prefixRepeat.join(''), 10);\n        }\n        if (this.motionRepeat.length > 0) {\n            repeat *= parseInt(this.motionRepeat.join(''), 10);\n        }\n    }\n    return repeat;\n};\nfunction clearInputState(cm, reason) {\n    cm.state.vim.inputState = new InputState();\n    cm.state.vim.expectLiteralNext = false;\n    CodeMirror.signal(cm, 'vim-command-done', reason);\n}\nfunction ChangeQueue() {\n    this.removed = [];\n    this.inserted = \"\";\n}\nfunction Register(text, linewise, blockwise) {\n    this.clear();\n    this.keyBuffer = [text || ''];\n    this.insertModeChanges = [];\n    this.searchQueries = [];\n    this.linewise = !!linewise;\n    this.blockwise = !!blockwise;\n}\nRegister.prototype = {\n    setText: function (text, linewise, blockwise) {\n        this.keyBuffer = [text || ''];\n        this.linewise = !!linewise;\n        this.blockwise = !!blockwise;\n    },\n    pushText: function (text, linewise) {\n        if (linewise) {\n            if (!this.linewise) {\n                this.keyBuffer.push('\\n');\n            }\n            this.linewise = true;\n        }\n        this.keyBuffer.push(text);\n    },\n    pushInsertModeChanges: function (changes) {\n        this.insertModeChanges.push(createInsertModeChanges(changes));\n    },\n    pushSearchQuery: function (query) {\n        this.searchQueries.push(query);\n    },\n    clear: function () {\n        this.keyBuffer = [];\n        this.insertModeChanges = [];\n        this.searchQueries = [];\n        this.linewise = false;\n    },\n    toString: function () {\n        return this.keyBuffer.join('');\n    }\n};\nfunction defineRegister(name, register) {\n    var registers = vimGlobalState.registerController.registers;\n    if (!name || name.length != 1) {\n        throw Error('Register name must be 1 character');\n    }\n    registers[name] = register;\n    validRegisters.push(name);\n}\nfunction RegisterController(registers) {\n    this.registers = registers;\n    this.unnamedRegister = registers['\"'] = new Register();\n    registers['.'] = new Register();\n    registers[':'] = new Register();\n    registers['/'] = new Register();\n    registers['+'] = new Register();\n}\nRegisterController.prototype = {\n    pushText: function (registerName, operator, text, linewise, blockwise) {\n        if (registerName === '_')\n            return;\n        if (linewise && text.charAt(text.length - 1) !== '\\n') {\n            text += '\\n';\n        }\n        var register = this.isValidRegister(registerName) ?\n            this.getRegister(registerName) : null;\n        if (!register) {\n            switch (operator) {\n                case 'yank':\n                    this.registers['0'] = new Register(text, linewise, blockwise);\n                    break;\n                case 'delete':\n                case 'change':\n                    if (text.indexOf('\\n') == -1) {\n                        this.registers['-'] = new Register(text, linewise);\n                    }\n                    else {\n                        this.shiftNumericRegisters_();\n                        this.registers['1'] = new Register(text, linewise);\n                    }\n                    break;\n            }\n            this.unnamedRegister.setText(text, linewise, blockwise);\n            return;\n        }\n        var append = isUpperCase(registerName);\n        if (append) {\n            register.pushText(text, linewise);\n        }\n        else {\n            register.setText(text, linewise, blockwise);\n        }\n        if (registerName === '+' && typeof navigator !== 'undefined' &&\n            typeof navigator.clipboard !== 'undefined' &&\n            typeof navigator.clipboard.readText === 'function') {\n            navigator.clipboard.writeText(text);\n        }\n        this.unnamedRegister.setText(register.toString(), linewise);\n    },\n    getRegister: function (name) {\n        if (!this.isValidRegister(name)) {\n            return this.unnamedRegister;\n        }\n        name = name.toLowerCase();\n        if (!this.registers[name]) {\n            this.registers[name] = new Register();\n        }\n        return this.registers[name];\n    },\n    isValidRegister: function (name) {\n        return name && (inArray(name, validRegisters) || latinCharRegex.test(name));\n    },\n    shiftNumericRegisters_: function () {\n        for (var i = 9; i >= 2; i--) {\n            this.registers[i] = this.getRegister('' + (i - 1));\n        }\n    }\n};\nfunction HistoryController() {\n    this.historyBuffer = [];\n    this.iterator = 0;\n    this.initialPrefix = null;\n}\nHistoryController.prototype = {\n    nextMatch: function (input, up) {\n        var historyBuffer = this.historyBuffer;\n        var dir = up ? -1 : 1;\n        if (this.initialPrefix === null)\n            this.initialPrefix = input;\n        for (var i = this.iterator + dir; up ? i >= 0 : i < historyBuffer.length; i += dir) {\n            var element = historyBuffer[i];\n            for (var j = 0; j <= element.length; j++) {\n                if (this.initialPrefix == element.substring(0, j)) {\n                    this.iterator = i;\n                    return element;\n                }\n            }\n        }\n        if (i >= historyBuffer.length) {\n            this.iterator = historyBuffer.length;\n            return this.initialPrefix;\n        }\n        if (i < 0)\n            return input;\n    },\n    pushInput: function (input) {\n        var index = this.historyBuffer.indexOf(input);\n        if (index > -1)\n            this.historyBuffer.splice(index, 1);\n        if (input.length)\n            this.historyBuffer.push(input);\n    },\n    reset: function () {\n        this.initialPrefix = null;\n        this.iterator = this.historyBuffer.length;\n    }\n};\nvar commandDispatcher = {\n    matchCommand: function (keys, keyMap, inputState, context) {\n        var matches = commandMatches(keys, keyMap, context, inputState);\n        if (!matches.full && !matches.partial) {\n            return { type: 'none' };\n        }\n        else if (!matches.full && matches.partial) {\n            return {\n                type: 'partial',\n                expectLiteralNext: matches.partial.length == 1 && matches.partial[0].keys.slice(-11) == '' // langmap literal logic\n            };\n        }\n        var bestMatch;\n        for (var i = 0; i < matches.full.length; i++) {\n            var match = matches.full[i];\n            if (!bestMatch) {\n                bestMatch = match;\n            }\n        }\n        if (bestMatch.keys.slice(-11) == '' || bestMatch.keys.slice(-10) == '') {\n            var character = lastChar(keys);\n            if (!character || character.length > 1)\n                return { type: 'clear' };\n            inputState.selectedCharacter = character;\n        }\n        return { type: 'full', command: bestMatch };\n    },\n    processCommand: function (cm, vim, command) {\n        vim.inputState.repeatOverride = command.repeatOverride;\n        switch (command.type) {\n            case 'motion':\n                this.processMotion(cm, vim, command);\n                break;\n            case 'operator':\n                this.processOperator(cm, vim, command);\n                break;\n            case 'operatorMotion':\n                this.processOperatorMotion(cm, vim, command);\n                break;\n            case 'action':\n                this.processAction(cm, vim, command);\n                break;\n            case 'search':\n                this.processSearch(cm, vim, command);\n                break;\n            case 'ex':\n            case 'keyToEx':\n                this.processEx(cm, vim, command);\n                break;\n            default:\n                break;\n        }\n    },\n    processMotion: function (cm, vim, command) {\n        vim.inputState.motion = command.motion;\n        vim.inputState.motionArgs = copyArgs(command.motionArgs);\n        this.evalInput(cm, vim);\n    },\n    processOperator: function (cm, vim, command) {\n        var inputState = vim.inputState;\n        if (inputState.operator) {\n            if (inputState.operator == command.operator) {\n                inputState.motion = 'expandToLine';\n                inputState.motionArgs = { linewise: true };\n                this.evalInput(cm, vim);\n                return;\n            }\n            else {\n                clearInputState(cm);\n            }\n        }\n        inputState.operator = command.operator;\n        inputState.operatorArgs = copyArgs(command.operatorArgs);\n        if (command.keys.length > 1) {\n            inputState.operatorShortcut = command.keys;\n        }\n        if (command.exitVisualBlock) {\n            vim.visualBlock = false;\n            updateCmSelection(cm);\n        }\n        if (vim.visualMode) {\n            this.evalInput(cm, vim);\n        }\n    },\n    processOperatorMotion: function (cm, vim, command) {\n        var visualMode = vim.visualMode;\n        var operatorMotionArgs = copyArgs(command.operatorMotionArgs);\n        if (operatorMotionArgs) {\n            if (visualMode && operatorMotionArgs.visualLine) {\n                vim.visualLine = true;\n            }\n        }\n        this.processOperator(cm, vim, command);\n        if (!visualMode) {\n            this.processMotion(cm, vim, command);\n        }\n    },\n    processAction: function (cm, vim, command) {\n        var inputState = vim.inputState;\n        var repeat = inputState.getRepeat();\n        var repeatIsExplicit = !!repeat;\n        var actionArgs = copyArgs(command.actionArgs) || {};\n        if (inputState.selectedCharacter) {\n            actionArgs.selectedCharacter = inputState.selectedCharacter;\n        }\n        if (command.operator) {\n            this.processOperator(cm, vim, command);\n        }\n        if (command.motion) {\n            this.processMotion(cm, vim, command);\n        }\n        if (command.motion || command.operator) {\n            this.evalInput(cm, vim);\n        }\n        actionArgs.repeat = repeat || 1;\n        actionArgs.repeatIsExplicit = repeatIsExplicit;\n        actionArgs.registerName = inputState.registerName;\n        clearInputState(cm);\n        vim.lastMotion = null;\n        if (command.isEdit) {\n            this.recordLastEdit(vim, inputState, command);\n        }\n        actions[command.action](cm, actionArgs, vim);\n    },\n    processSearch: function (cm, vim, command) {\n        if (!cm.getSearchCursor) {\n            return;\n        }\n        var forward = command.searchArgs.forward;\n        var wholeWordOnly = command.searchArgs.wholeWordOnly;\n        getSearchState(cm).setReversed(!forward);\n        var promptPrefix = (forward) ? '/' : '?';\n        var originalQuery = getSearchState(cm).getQuery();\n        var originalScrollPos = cm.getScrollInfo();\n        function handleQuery(query, ignoreCase, smartCase) {\n            vimGlobalState.searchHistoryController.pushInput(query);\n            vimGlobalState.searchHistoryController.reset();\n            try {\n                updateSearchQuery(cm, query, ignoreCase, smartCase);\n            }\n            catch (e) {\n                showConfirm(cm, 'Invalid regex: ' + query);\n                clearInputState(cm);\n                return;\n            }\n            commandDispatcher.processMotion(cm, vim, {\n                type: 'motion',\n                motion: 'findNext',\n                motionArgs: { forward: true, toJumplist: command.searchArgs.toJumplist }\n            });\n        }\n        function onPromptClose(query) {\n            handleQuery(query, true /** ignoreCase */, true /** smartCase */);\n            var macroModeState = vimGlobalState.macroModeState;\n            if (macroModeState.isRecording) {\n                logSearchQuery(macroModeState, query);\n            }\n        }\n        function onPromptKeyUp(e, query, close) {\n            var keyName = vimKeyFromEvent(e), up, offset;\n            if (keyName == '' || keyName == '') {\n                up = keyName == '' ? true : false;\n                offset = e.target ? e.target.selectionEnd : 0;\n                query = vimGlobalState.searchHistoryController.nextMatch(query, up) || '';\n                close(query);\n                if (offset && e.target)\n                    e.target.selectionEnd = e.target.selectionStart = Math.min(offset, e.target.value.length);\n            }\n            else if (keyName && keyName != '' && keyName != '') {\n                vimGlobalState.searchHistoryController.reset();\n            }\n            var parsedQuery;\n            try {\n                parsedQuery = updateSearchQuery(cm, query, true /** ignoreCase */, true /** smartCase */);\n            }\n            catch (e) {\n            }\n            if (parsedQuery) {\n                cm.scrollIntoView(findNext(cm, !forward, parsedQuery), 30);\n            }\n            else {\n                clearSearchHighlight(cm);\n                cm.scrollTo(originalScrollPos.left, originalScrollPos.top);\n            }\n        }\n        function onPromptKeyDown(e, query, close) {\n            var keyName = vimKeyFromEvent(e);\n            if (keyName == '' || keyName == '' || keyName == '' ||\n                (keyName == '' && query == '')) {\n                vimGlobalState.searchHistoryController.pushInput(query);\n                vimGlobalState.searchHistoryController.reset();\n                updateSearchQuery(cm, originalQuery);\n                clearSearchHighlight(cm);\n                cm.scrollTo(originalScrollPos.left, originalScrollPos.top);\n                CodeMirror.e_stop(e);\n                clearInputState(cm);\n                close();\n                cm.focus();\n            }\n            else if (keyName == '' || keyName == '') {\n                CodeMirror.e_stop(e);\n            }\n            else if (keyName == '') {\n                CodeMirror.e_stop(e);\n                close('');\n            }\n        }\n        switch (command.searchArgs.querySrc) {\n            case 'prompt':\n                var macroModeState = vimGlobalState.macroModeState;\n                if (macroModeState.isPlaying) {\n                    var query = macroModeState.replaySearchQueries.shift();\n                    handleQuery(query, true /** ignoreCase */, false /** smartCase */);\n                }\n                else {\n                    showPrompt(cm, {\n                        onClose: onPromptClose,\n                        prefix: promptPrefix,\n                        desc: '(JavaScript regexp)',\n                        onKeyUp: onPromptKeyUp,\n                        onKeyDown: onPromptKeyDown\n                    });\n                }\n                break;\n            case 'wordUnderCursor':\n                var word = expandWordUnderCursor(cm, { noSymbol: true });\n                var isKeyword = true;\n                if (!word) {\n                    word = expandWordUnderCursor(cm, { noSymbol: false });\n                    isKeyword = false;\n                }\n                if (!word) {\n                    showConfirm(cm, 'No word under cursor');\n                    clearInputState(cm);\n                    return;\n                }\n                var query = cm.getLine(word.start.line).substring(word.start.ch, word.end.ch);\n                if (isKeyword && wholeWordOnly) {\n                    query = '\\\\b' + query + '\\\\b';\n                }\n                else {\n                    query = escapeRegex(query);\n                }\n                vimGlobalState.jumpList.cachedCursor = cm.getCursor();\n                cm.setCursor(word.start);\n                handleQuery(query, true /** ignoreCase */, false /** smartCase */);\n                break;\n        }\n    },\n    processEx: function (cm, vim, command) {\n        function onPromptClose(input) {\n            vimGlobalState.exCommandHistoryController.pushInput(input);\n            vimGlobalState.exCommandHistoryController.reset();\n            exCommandDispatcher.processCommand(cm, input);\n            if (cm.state.vim)\n                clearInputState(cm);\n        }\n        function onPromptKeyDown(e, input, close) {\n            var keyName = vimKeyFromEvent(e), up, offset;\n            if (keyName == '' || keyName == '' || keyName == '' ||\n                (keyName == '' && input == '')) {\n                vimGlobalState.exCommandHistoryController.pushInput(input);\n                vimGlobalState.exCommandHistoryController.reset();\n                CodeMirror.e_stop(e);\n                clearInputState(cm);\n                close();\n                cm.focus();\n            }\n            if (keyName == '' || keyName == '') {\n                CodeMirror.e_stop(e);\n                up = keyName == '' ? true : false;\n                offset = e.target ? e.target.selectionEnd : 0;\n                input = vimGlobalState.exCommandHistoryController.nextMatch(input, up) || '';\n                close(input);\n                if (offset && e.target)\n                    e.target.selectionEnd = e.target.selectionStart = Math.min(offset, e.target.value.length);\n            }\n            else if (keyName == '') {\n                CodeMirror.e_stop(e);\n                close('');\n            }\n            else if (keyName && keyName != '' && keyName != '') {\n                vimGlobalState.exCommandHistoryController.reset();\n            }\n        }\n        if (command.type == 'keyToEx') {\n            exCommandDispatcher.processCommand(cm, command.exArgs.input);\n        }\n        else {\n            if (vim.visualMode) {\n                showPrompt(cm, { onClose: onPromptClose, prefix: ':', value: '\\'<,\\'>',\n                    onKeyDown: onPromptKeyDown, selectValueOnOpen: false });\n            }\n            else {\n                showPrompt(cm, { onClose: onPromptClose, prefix: ':',\n                    onKeyDown: onPromptKeyDown });\n            }\n        }\n    },\n    evalInput: function (cm, vim) {\n        var inputState = vim.inputState;\n        var motion = inputState.motion;\n        var motionArgs = inputState.motionArgs || {};\n        var operator = inputState.operator;\n        var operatorArgs = inputState.operatorArgs || {};\n        var registerName = inputState.registerName;\n        var sel = vim.sel;\n        var origHead = copyCursor(vim.visualMode ? clipCursorToContent(cm, sel.head) : cm.getCursor('head'));\n        var origAnchor = copyCursor(vim.visualMode ? clipCursorToContent(cm, sel.anchor) : cm.getCursor('anchor'));\n        var oldHead = copyCursor(origHead);\n        var oldAnchor = copyCursor(origAnchor);\n        var newHead, newAnchor;\n        var repeat;\n        if (operator) {\n            this.recordLastEdit(vim, inputState);\n        }\n        if (inputState.repeatOverride !== undefined) {\n            repeat = inputState.repeatOverride;\n        }\n        else {\n            repeat = inputState.getRepeat();\n        }\n        if (repeat > 0 && motionArgs.explicitRepeat) {\n            motionArgs.repeatIsExplicit = true;\n        }\n        else if (motionArgs.noRepeat ||\n            (!motionArgs.explicitRepeat && repeat === 0)) {\n            repeat = 1;\n            motionArgs.repeatIsExplicit = false;\n        }\n        if (inputState.selectedCharacter) {\n            motionArgs.selectedCharacter = operatorArgs.selectedCharacter =\n                inputState.selectedCharacter;\n        }\n        motionArgs.repeat = repeat;\n        clearInputState(cm);\n        if (motion) {\n            var motionResult = motions[motion](cm, origHead, motionArgs, vim, inputState);\n            vim.lastMotion = motions[motion];\n            if (!motionResult) {\n                return;\n            }\n            if (motionArgs.toJumplist) {\n                if (!operator && cm.ace.curOp != null)\n                    cm.ace.curOp.command.scrollIntoView = \"center-animate\"; // ace_patch\n                var jumpList = vimGlobalState.jumpList;\n                var cachedCursor = jumpList.cachedCursor;\n                if (cachedCursor) {\n                    recordJumpPosition(cm, cachedCursor, motionResult);\n                    delete jumpList.cachedCursor;\n                }\n                else {\n                    recordJumpPosition(cm, origHead, motionResult);\n                }\n            }\n            if (motionResult instanceof Array) {\n                newAnchor = motionResult[0];\n                newHead = motionResult[1];\n            }\n            else {\n                newHead = motionResult;\n            }\n            if (!newHead) {\n                newHead = copyCursor(origHead);\n            }\n            if (vim.visualMode) {\n                if (!(vim.visualBlock && newHead.ch === Infinity)) {\n                    newHead = clipCursorToContent(cm, newHead, oldHead);\n                }\n                if (newAnchor) {\n                    newAnchor = clipCursorToContent(cm, newAnchor);\n                }\n                newAnchor = newAnchor || oldAnchor;\n                sel.anchor = newAnchor;\n                sel.head = newHead;\n                updateCmSelection(cm);\n                updateMark(cm, vim, '<', cursorIsBefore(newAnchor, newHead) ? newAnchor\n                    : newHead);\n                updateMark(cm, vim, '>', cursorIsBefore(newAnchor, newHead) ? newHead\n                    : newAnchor);\n            }\n            else if (!operator) {\n                if (cm.ace.curOp)\n                    cm.ace.curOp.vimDialogScroll = \"center-animate\"; // ace_patch\n                newHead = clipCursorToContent(cm, newHead, oldHead);\n                cm.setCursor(newHead.line, newHead.ch);\n            }\n        }\n        if (operator) {\n            if (operatorArgs.lastSel) {\n                newAnchor = oldAnchor;\n                var lastSel = operatorArgs.lastSel;\n                var lineOffset = Math.abs(lastSel.head.line - lastSel.anchor.line);\n                var chOffset = Math.abs(lastSel.head.ch - lastSel.anchor.ch);\n                if (lastSel.visualLine) {\n                    newHead = new Pos(oldAnchor.line + lineOffset, oldAnchor.ch);\n                }\n                else if (lastSel.visualBlock) {\n                    newHead = new Pos(oldAnchor.line + lineOffset, oldAnchor.ch + chOffset);\n                }\n                else if (lastSel.head.line == lastSel.anchor.line) {\n                    newHead = new Pos(oldAnchor.line, oldAnchor.ch + chOffset);\n                }\n                else {\n                    newHead = new Pos(oldAnchor.line + lineOffset, oldAnchor.ch);\n                }\n                vim.visualMode = true;\n                vim.visualLine = lastSel.visualLine;\n                vim.visualBlock = lastSel.visualBlock;\n                sel = vim.sel = {\n                    anchor: newAnchor,\n                    head: newHead\n                };\n                updateCmSelection(cm);\n            }\n            else if (vim.visualMode) {\n                operatorArgs.lastSel = {\n                    anchor: copyCursor(sel.anchor),\n                    head: copyCursor(sel.head),\n                    visualBlock: vim.visualBlock,\n                    visualLine: vim.visualLine\n                };\n            }\n            var curStart, curEnd, linewise, mode;\n            var cmSel;\n            if (vim.visualMode) {\n                curStart = cursorMin(sel.head, sel.anchor);\n                curEnd = cursorMax(sel.head, sel.anchor);\n                linewise = vim.visualLine || operatorArgs.linewise;\n                mode = vim.visualBlock ? 'block' :\n                    linewise ? 'line' :\n                        'char';\n                var newPositions = updateSelectionForSurrogateCharacters(cm, curStart, curEnd);\n                cmSel = makeCmSelection(cm, {\n                    anchor: newPositions.start,\n                    head: newPositions.end\n                }, mode);\n                if (linewise) {\n                    var ranges = cmSel.ranges;\n                    if (mode == 'block') {\n                        for (var i = 0; i < ranges.length; i++) {\n                            ranges[i].head.ch = lineLength(cm, ranges[i].head.line);\n                        }\n                    }\n                    else if (mode == 'line') {\n                        ranges[0].head = new Pos(ranges[0].head.line + 1, 0);\n                    }\n                }\n            }\n            else {\n                curStart = copyCursor(newAnchor || oldAnchor);\n                curEnd = copyCursor(newHead || oldHead);\n                if (cursorIsBefore(curEnd, curStart)) {\n                    var tmp = curStart;\n                    curStart = curEnd;\n                    curEnd = tmp;\n                }\n                linewise = motionArgs.linewise || operatorArgs.linewise;\n                if (linewise) {\n                    expandSelectionToLine(cm, curStart, curEnd);\n                }\n                else if (motionArgs.forward) {\n                    clipToLine(cm, curStart, curEnd);\n                }\n                mode = 'char';\n                var exclusive = !motionArgs.inclusive || linewise;\n                var newPositions = updateSelectionForSurrogateCharacters(cm, curStart, curEnd);\n                cmSel = makeCmSelection(cm, {\n                    anchor: newPositions.start,\n                    head: newPositions.end\n                }, mode, exclusive);\n            }\n            cm.setSelections(cmSel.ranges, cmSel.primary);\n            vim.lastMotion = null;\n            operatorArgs.repeat = repeat; // For indent in visual mode.\n            operatorArgs.registerName = registerName;\n            operatorArgs.linewise = linewise;\n            var operatorMoveTo = operators[operator](cm, operatorArgs, cmSel.ranges, oldAnchor, newHead);\n            if (vim.visualMode) {\n                exitVisualMode(cm, operatorMoveTo != null);\n            }\n            if (operatorMoveTo) {\n                cm.setCursor(operatorMoveTo);\n            }\n        }\n    },\n    recordLastEdit: function (vim, inputState, actionCommand) {\n        var macroModeState = vimGlobalState.macroModeState;\n        if (macroModeState.isPlaying) {\n            return;\n        }\n        vim.lastEditInputState = inputState;\n        vim.lastEditActionCommand = actionCommand;\n        macroModeState.lastInsertModeChanges.changes = [];\n        macroModeState.lastInsertModeChanges.expectCursorActivityForChange = false;\n        macroModeState.lastInsertModeChanges.visualBlock = vim.visualBlock ? vim.sel.head.line - vim.sel.anchor.line : 0;\n    }\n};\nvar motions = {\n    moveToTopLine: function (cm, _head, motionArgs) {\n        var line = getUserVisibleLines(cm).top + motionArgs.repeat - 1;\n        return new Pos(line, findFirstNonWhiteSpaceCharacter(cm.getLine(line)));\n    },\n    moveToMiddleLine: function (cm) {\n        var range = getUserVisibleLines(cm);\n        var line = Math.floor((range.top + range.bottom) * 0.5);\n        return new Pos(line, findFirstNonWhiteSpaceCharacter(cm.getLine(line)));\n    },\n    moveToBottomLine: function (cm, _head, motionArgs) {\n        var line = getUserVisibleLines(cm).bottom - motionArgs.repeat + 1;\n        return new Pos(line, findFirstNonWhiteSpaceCharacter(cm.getLine(line)));\n    },\n    expandToLine: function (_cm, head, motionArgs) {\n        var cur = head;\n        return new Pos(cur.line + motionArgs.repeat - 1, Infinity);\n    },\n    findNext: function (cm, _head, motionArgs) {\n        var state = getSearchState(cm);\n        var query = state.getQuery();\n        if (!query) {\n            return;\n        }\n        var prev = !motionArgs.forward;\n        prev = (state.isReversed()) ? !prev : prev;\n        highlightSearchMatches(cm, query);\n        return findNext(cm, prev /** prev */, query, motionArgs.repeat);\n    },\n    findAndSelectNextInclusive: function (cm, _head, motionArgs, vim, prevInputState) {\n        var state = getSearchState(cm);\n        var query = state.getQuery();\n        if (!query) {\n            return;\n        }\n        var prev = !motionArgs.forward;\n        prev = (state.isReversed()) ? !prev : prev;\n        var next = findNextFromAndToInclusive(cm, prev, query, motionArgs.repeat, vim);\n        if (!next) {\n            return;\n        }\n        if (prevInputState.operator) {\n            return next;\n        }\n        var from = next[0];\n        var to = new Pos(next[1].line, next[1].ch - 1);\n        if (vim.visualMode) {\n            if (vim.visualLine || vim.visualBlock) {\n                vim.visualLine = false;\n                vim.visualBlock = false;\n                CodeMirror.signal(cm, \"vim-mode-change\", { mode: \"visual\", subMode: \"\" });\n            }\n            var anchor = vim.sel.anchor;\n            if (anchor) {\n                if (state.isReversed()) {\n                    if (motionArgs.forward) {\n                        return [anchor, from];\n                    }\n                    return [anchor, to];\n                }\n                else {\n                    if (motionArgs.forward) {\n                        return [anchor, to];\n                    }\n                    return [anchor, from];\n                }\n            }\n        }\n        else {\n            vim.visualMode = true;\n            vim.visualLine = false;\n            vim.visualBlock = false;\n            CodeMirror.signal(cm, \"vim-mode-change\", { mode: \"visual\", subMode: \"\" });\n        }\n        return prev ? [to, from] : [from, to];\n    },\n    goToMark: function (cm, _head, motionArgs, vim) {\n        var pos = getMarkPos(cm, vim, motionArgs.selectedCharacter);\n        if (pos) {\n            return motionArgs.linewise ? { line: pos.line, ch: findFirstNonWhiteSpaceCharacter(cm.getLine(pos.line)) } : pos;\n        }\n        return null;\n    },\n    moveToOtherHighlightedEnd: function (cm, _head, motionArgs, vim) {\n        if (vim.visualBlock && motionArgs.sameLine) {\n            var sel = vim.sel;\n            return [\n                clipCursorToContent(cm, new Pos(sel.anchor.line, sel.head.ch)),\n                clipCursorToContent(cm, new Pos(sel.head.line, sel.anchor.ch))\n            ];\n        }\n        else {\n            return ([vim.sel.head, vim.sel.anchor]);\n        }\n    },\n    jumpToMark: function (cm, head, motionArgs, vim) {\n        var best = head;\n        for (var i = 0; i < motionArgs.repeat; i++) {\n            var cursor = best;\n            for (var key in vim.marks) {\n                if (!isLowerCase(key)) {\n                    continue;\n                }\n                var mark = vim.marks[key].find();\n                var isWrongDirection = (motionArgs.forward) ?\n                    cursorIsBefore(mark, cursor) : cursorIsBefore(cursor, mark);\n                if (isWrongDirection) {\n                    continue;\n                }\n                if (motionArgs.linewise && (mark.line == cursor.line)) {\n                    continue;\n                }\n                var equal = cursorEqual(cursor, best);\n                var between = (motionArgs.forward) ?\n                    cursorIsBetween(cursor, mark, best) :\n                    cursorIsBetween(best, mark, cursor);\n                if (equal || between) {\n                    best = mark;\n                }\n            }\n        }\n        if (motionArgs.linewise) {\n            best = new Pos(best.line, findFirstNonWhiteSpaceCharacter(cm.getLine(best.line)));\n        }\n        return best;\n    },\n    moveByCharacters: function (_cm, head, motionArgs) {\n        var cur = head;\n        var repeat = motionArgs.repeat;\n        var ch = motionArgs.forward ? cur.ch + repeat : cur.ch - repeat;\n        return new Pos(cur.line, ch);\n    },\n    moveByLines: function (cm, head, motionArgs, vim) {\n        var cur = head;\n        var endCh = cur.ch;\n        switch (vim.lastMotion) {\n            case this.moveByLines:\n            case this.moveByDisplayLines:\n            case this.moveByScroll:\n            case this.moveToColumn:\n            case this.moveToEol:\n                endCh = vim.lastHPos;\n                break;\n            default:\n                vim.lastHPos = endCh;\n        }\n        var repeat = motionArgs.repeat + (motionArgs.repeatOffset || 0);\n        var line = motionArgs.forward ? cur.line + repeat : cur.line - repeat;\n        var first = cm.firstLine();\n        var last = cm.lastLine();\n        if (line < first && cur.line == first) {\n            return this.moveToStartOfLine(cm, head, motionArgs, vim);\n        }\n        else if (line > last && cur.line == last) {\n            return moveToEol(cm, head, motionArgs, vim, true);\n        }\n        var fold = cm.ace.session.getFoldLine(line);\n        if (fold) {\n            if (motionArgs.forward) {\n                if (line > fold.start.row)\n                    line = fold.end.row + 1;\n            }\n            else {\n                line = fold.start.row;\n            }\n        }\n        if (motionArgs.toFirstChar) {\n            endCh = findFirstNonWhiteSpaceCharacter(cm.getLine(line));\n            vim.lastHPos = endCh;\n        }\n        vim.lastHSPos = cm.charCoords(new Pos(line, endCh), 'div').left;\n        return new Pos(line, endCh);\n    },\n    moveByDisplayLines: function (cm, head, motionArgs, vim) {\n        var cur = head;\n        switch (vim.lastMotion) {\n            case this.moveByDisplayLines:\n            case this.moveByScroll:\n            case this.moveByLines:\n            case this.moveToColumn:\n            case this.moveToEol:\n                break;\n            default:\n                vim.lastHSPos = cm.charCoords(cur, 'div').left;\n        }\n        var repeat = motionArgs.repeat;\n        var res = cm.findPosV(cur, (motionArgs.forward ? repeat : -repeat), 'line', vim.lastHSPos);\n        if (res.hitSide) {\n            if (motionArgs.forward) {\n                var lastCharCoords = cm.charCoords(res, 'div');\n                var goalCoords = { top: lastCharCoords.top + 8, left: vim.lastHSPos };\n                var res = cm.coordsChar(goalCoords, 'div');\n            }\n            else {\n                var resCoords = cm.charCoords(new Pos(cm.firstLine(), 0), 'div');\n                resCoords.left = vim.lastHSPos;\n                res = cm.coordsChar(resCoords, 'div');\n            }\n        }\n        vim.lastHPos = res.ch;\n        return res;\n    },\n    moveByPage: function (cm, head, motionArgs) {\n        var curStart = head;\n        var repeat = motionArgs.repeat;\n        return cm.findPosV(curStart, (motionArgs.forward ? repeat : -repeat), 'page');\n    },\n    moveByParagraph: function (cm, head, motionArgs) {\n        var dir = motionArgs.forward ? 1 : -1;\n        return findParagraph(cm, head, motionArgs.repeat, dir);\n    },\n    moveBySentence: function (cm, head, motionArgs) {\n        var dir = motionArgs.forward ? 1 : -1;\n        return findSentence(cm, head, motionArgs.repeat, dir);\n    },\n    moveByScroll: function (cm, head, motionArgs, vim) {\n        var scrollbox = cm.getScrollInfo();\n        var curEnd = null;\n        var repeat = motionArgs.repeat;\n        if (!repeat) {\n            repeat = scrollbox.clientHeight / (2 * cm.defaultTextHeight());\n        }\n        var orig = cm.charCoords(head, 'local');\n        motionArgs.repeat = repeat;\n        curEnd = motions.moveByDisplayLines(cm, head, motionArgs, vim);\n        if (!curEnd) {\n            return null;\n        }\n        var dest = cm.charCoords(curEnd, 'local');\n        cm.scrollTo(null, scrollbox.top + dest.top - orig.top);\n        return curEnd;\n    },\n    moveByWords: function (cm, head, motionArgs) {\n        return moveToWord(cm, head, motionArgs.repeat, !!motionArgs.forward, !!motionArgs.wordEnd, !!motionArgs.bigWord);\n    },\n    moveTillCharacter: function (cm, head, motionArgs) {\n        var repeat = motionArgs.repeat;\n        var curEnd = moveToCharacter(cm, repeat, motionArgs.forward, motionArgs.selectedCharacter, head);\n        var increment = motionArgs.forward ? -1 : 1;\n        recordLastCharacterSearch(increment, motionArgs);\n        if (!curEnd)\n            return null;\n        curEnd.ch += increment;\n        return curEnd;\n    },\n    moveToCharacter: function (cm, head, motionArgs) {\n        var repeat = motionArgs.repeat;\n        recordLastCharacterSearch(0, motionArgs);\n        return moveToCharacter(cm, repeat, motionArgs.forward, motionArgs.selectedCharacter, head) || head;\n    },\n    moveToSymbol: function (cm, head, motionArgs) {\n        var repeat = motionArgs.repeat;\n        return findSymbol(cm, repeat, motionArgs.forward, motionArgs.selectedCharacter) || head;\n    },\n    moveToColumn: function (cm, head, motionArgs, vim) {\n        var repeat = motionArgs.repeat;\n        vim.lastHPos = repeat - 1;\n        vim.lastHSPos = cm.charCoords(head, 'div').left;\n        return moveToColumn(cm, repeat);\n    },\n    moveToEol: function (cm, head, motionArgs, vim) {\n        return moveToEol(cm, head, motionArgs, vim, false);\n    },\n    moveToFirstNonWhiteSpaceCharacter: function (cm, head) {\n        var cursor = head;\n        return new Pos(cursor.line, findFirstNonWhiteSpaceCharacter(cm.getLine(cursor.line)));\n    },\n    moveToMatchedSymbol: function (cm, head) {\n        var cursor = head;\n        var line = cursor.line;\n        var ch = cursor.ch;\n        var lineText = cm.getLine(line);\n        var symbol;\n        for (; ch < lineText.length; ch++) {\n            symbol = lineText.charAt(ch);\n            if (symbol && isMatchableSymbol(symbol)) {\n                var style = cm.getTokenTypeAt(new Pos(line, ch + 1));\n                if (style !== \"string\" && style !== \"comment\") {\n                    break;\n                }\n            }\n        }\n        if (ch < lineText.length) {\n            var re = /[<>]/.test(lineText[ch]) ? /[(){}[\\]<>]/ : /[(){}[\\]]/; //ace_patch?\n            var matched = cm.findMatchingBracket(new Pos(line, ch + 1), { bracketRegex: re });\n            return matched.to;\n        }\n        else {\n            return cursor;\n        }\n    },\n    moveToStartOfLine: function (_cm, head) {\n        return new Pos(head.line, 0);\n    },\n    moveToLineOrEdgeOfDocument: function (cm, _head, motionArgs) {\n        var lineNum = motionArgs.forward ? cm.lastLine() : cm.firstLine();\n        if (motionArgs.repeatIsExplicit) {\n            lineNum = motionArgs.repeat - cm.getOption('firstLineNumber');\n        }\n        return new Pos(lineNum, findFirstNonWhiteSpaceCharacter(cm.getLine(lineNum)));\n    },\n    moveToStartOfDisplayLine: function (cm) {\n        cm.execCommand(\"goLineLeft\");\n        return cm.getCursor();\n    },\n    moveToEndOfDisplayLine: function (cm) {\n        cm.execCommand(\"goLineRight\");\n        var head = cm.getCursor();\n        if (head.sticky == \"before\")\n            head.ch--;\n        return head;\n    },\n    textObjectManipulation: function (cm, head, motionArgs, vim) {\n        var mirroredPairs = { '(': ')', ')': '(',\n            '{': '}', '}': '{',\n            '[': ']', ']': '[',\n            '<': '>', '>': '<' };\n        var selfPaired = { '\\'': true, '\"': true, '`': true };\n        var character = motionArgs.selectedCharacter;\n        if (character == 'b') {\n            character = '(';\n        }\n        else if (character == 'B') {\n            character = '{';\n        }\n        var inclusive = !motionArgs.textObjectInner;\n        var tmp, move;\n        if (mirroredPairs[character]) {\n            move = true;\n            tmp = selectCompanionObject(cm, head, character, inclusive);\n            if (!tmp) {\n                var sc = cm.getSearchCursor(new RegExp(\"\\\\\" + character, \"g\"), head);\n                if (sc.find()) {\n                    tmp = selectCompanionObject(cm, sc.from(), character, inclusive);\n                }\n            }\n        }\n        else if (selfPaired[character]) {\n            move = true;\n            tmp = findBeginningAndEnd(cm, head, character, inclusive);\n        }\n        else if (character === 'W' || character === 'w') {\n            var repeat = motionArgs.repeat || 1;\n            while (repeat-- > 0) {\n                var repeated = expandWordUnderCursor(cm, {\n                    inclusive: inclusive,\n                    innerWord: !inclusive,\n                    bigWord: character === 'W',\n                    noSymbol: character === 'W',\n                    multiline: true\n                }, tmp && tmp.end);\n                if (repeated) {\n                    if (!tmp)\n                        tmp = repeated;\n                    tmp.end = repeated.end;\n                }\n            }\n        }\n        else if (character === 'p') {\n            tmp = findParagraph(cm, head, motionArgs.repeat, 0, inclusive);\n            motionArgs.linewise = true;\n            if (vim.visualMode) {\n                if (!vim.visualLine) {\n                    vim.visualLine = true;\n                }\n            }\n            else {\n                var operatorArgs = vim.inputState.operatorArgs;\n                if (operatorArgs) {\n                    operatorArgs.linewise = true;\n                }\n                tmp.end.line--;\n            }\n        }\n        else if (character === 't') {\n            tmp = expandTagUnderCursor(cm, head, inclusive);\n        }\n        else if (character === 's') {\n            var content = cm.getLine(head.line);\n            if (head.ch > 0 && isEndOfSentenceSymbol(content[head.ch])) {\n                head.ch -= 1;\n            }\n            var end = getSentence(cm, head, motionArgs.repeat, 1, inclusive);\n            var start = getSentence(cm, head, motionArgs.repeat, -1, inclusive);\n            if (isWhiteSpaceString(cm.getLine(start.line)[start.ch])\n                && isWhiteSpaceString(cm.getLine(end.line)[end.ch - 1])) {\n                start = { line: start.line, ch: start.ch + 1 };\n            }\n            tmp = { start: start, end: end };\n        }\n        if (!tmp) {\n            return null;\n        }\n        if (!cm.state.vim.visualMode) {\n            return [tmp.start, tmp.end];\n        }\n        else {\n            return expandSelection(cm, tmp.start, tmp.end, move);\n        }\n    },\n    repeatLastCharacterSearch: function (cm, head, motionArgs) {\n        var lastSearch = vimGlobalState.lastCharacterSearch;\n        var repeat = motionArgs.repeat;\n        var forward = motionArgs.forward === lastSearch.forward;\n        var increment = (lastSearch.increment ? 1 : 0) * (forward ? -1 : 1);\n        cm.moveH(-increment, 'char');\n        motionArgs.inclusive = forward ? true : false;\n        var curEnd = moveToCharacter(cm, repeat, forward, lastSearch.selectedCharacter);\n        if (!curEnd) {\n            cm.moveH(increment, 'char');\n            return head;\n        }\n        curEnd.ch += increment;\n        return curEnd;\n    }\n};\nfunction defineMotion(name, fn) {\n    motions[name] = fn;\n}\nfunction fillArray(val, times) {\n    var arr = [];\n    for (var i = 0; i < times; i++) {\n        arr.push(val);\n    }\n    return arr;\n}\nvar operators = {\n    change: function (cm, args, ranges) {\n        var finalHead, text;\n        var vim = cm.state.vim;\n        var anchor = ranges[0].anchor, head = ranges[0].head;\n        if (!vim.visualMode) {\n            text = cm.getRange(anchor, head);\n            var lastState = vim.lastEditInputState || {};\n            if (lastState.motion == \"moveByWords\" && !isWhiteSpaceString(text)) {\n                var match = (/\\s+$/).exec(text);\n                if (match && lastState.motionArgs && lastState.motionArgs.forward) {\n                    head = offsetCursor(head, 0, -match[0].length);\n                    text = text.slice(0, -match[0].length);\n                }\n            }\n            if (args.linewise) {\n                anchor = new Pos(anchor.line, findFirstNonWhiteSpaceCharacter(cm.getLine(anchor.line)));\n                if (head.line > anchor.line) {\n                    head = new Pos(head.line - 1, Number.MAX_VALUE);\n                }\n            }\n            cm.replaceRange('', anchor, head);\n            finalHead = anchor;\n        }\n        else if (args.fullLine) {\n            head.ch = Number.MAX_VALUE;\n            head.line--;\n            cm.setSelection(anchor, head);\n            text = cm.getSelection();\n            cm.replaceSelection(\"\");\n            finalHead = anchor;\n        }\n        else {\n            text = cm.getSelection();\n            var replacement = fillArray('', ranges.length);\n            cm.replaceSelections(replacement);\n            finalHead = cursorMin(ranges[0].head, ranges[0].anchor);\n        }\n        vimGlobalState.registerController.pushText(args.registerName, 'change', text, args.linewise, ranges.length > 1);\n        actions.enterInsertMode(cm, { head: finalHead }, cm.state.vim);\n    },\n    'delete': function (cm, args, ranges) {\n        var finalHead, text;\n        var vim = cm.state.vim;\n        if (!vim.visualBlock) {\n            var anchor = ranges[0].anchor, head = ranges[0].head;\n            if (args.linewise &&\n                head.line != cm.firstLine() &&\n                anchor.line == cm.lastLine() &&\n                anchor.line == head.line - 1) {\n                if (anchor.line == cm.firstLine()) {\n                    anchor.ch = 0;\n                }\n                else {\n                    anchor = new Pos(anchor.line - 1, lineLength(cm, anchor.line - 1));\n                }\n            }\n            text = cm.getRange(anchor, head);\n            cm.replaceRange('', anchor, head);\n            finalHead = anchor;\n            if (args.linewise) {\n                finalHead = motions.moveToFirstNonWhiteSpaceCharacter(cm, anchor);\n            }\n        }\n        else {\n            text = cm.getSelection();\n            var replacement = fillArray('', ranges.length);\n            cm.replaceSelections(replacement);\n            finalHead = cursorMin(ranges[0].head, ranges[0].anchor);\n        }\n        vimGlobalState.registerController.pushText(args.registerName, 'delete', text, args.linewise, vim.visualBlock);\n        return clipCursorToContent(cm, finalHead);\n    },\n    indent: function (cm, args, ranges) {\n        var vim = cm.state.vim;\n        if (cm.indentMore) {\n            var repeat = (vim.visualMode) ? args.repeat : 1;\n            for (var j = 0; j < repeat; j++) {\n                if (args.indentRight)\n                    cm.indentMore();\n                else\n                    cm.indentLess();\n            }\n        }\n        else {\n            var startLine = ranges[0].anchor.line;\n            var endLine = vim.visualBlock ?\n                ranges[ranges.length - 1].anchor.line :\n                ranges[0].head.line;\n            var repeat = (vim.visualMode) ? args.repeat : 1;\n            if (args.linewise) {\n                endLine--;\n            }\n            for (var i = startLine; i <= endLine; i++) {\n                for (var j = 0; j < repeat; j++) {\n                    cm.indentLine(i, args.indentRight);\n                }\n            }\n        }\n        return motions.moveToFirstNonWhiteSpaceCharacter(cm, ranges[0].anchor);\n    },\n    indentAuto: function (cm, _args, ranges) {\n        cm.execCommand(\"indentAuto\");\n        return motions.moveToFirstNonWhiteSpaceCharacter(cm, ranges[0].anchor);\n    },\n    hardWrap: function (cm, operatorArgs, ranges, oldAnchor, newHead) {\n        if (!cm.hardWrap)\n            return;\n        var from = ranges[0].anchor.line;\n        var to = ranges[0].head.line;\n        if (operatorArgs.linewise)\n            to--;\n        var endRow = cm.hardWrap({ from: from, to: to });\n        if (endRow > from && operatorArgs.linewise)\n            endRow--;\n        return operatorArgs.keepCursor ? oldAnchor : new Pos(endRow, 0);\n    },\n    changeCase: function (cm, args, ranges, oldAnchor, newHead) {\n        var selections = cm.getSelections();\n        var swapped = [];\n        var toLower = args.toLower;\n        for (var j = 0; j < selections.length; j++) {\n            var toSwap = selections[j];\n            var text = '';\n            if (toLower === true) {\n                text = toSwap.toLowerCase();\n            }\n            else if (toLower === false) {\n                text = toSwap.toUpperCase();\n            }\n            else {\n                for (var i = 0; i < toSwap.length; i++) {\n                    var character = toSwap.charAt(i);\n                    text += isUpperCase(character) ? character.toLowerCase() :\n                        character.toUpperCase();\n                }\n            }\n            swapped.push(text);\n        }\n        cm.replaceSelections(swapped);\n        if (args.shouldMoveCursor) {\n            return newHead;\n        }\n        else if (!cm.state.vim.visualMode && args.linewise && ranges[0].anchor.line + 1 == ranges[0].head.line) {\n            return motions.moveToFirstNonWhiteSpaceCharacter(cm, oldAnchor);\n        }\n        else if (args.linewise) {\n            return oldAnchor;\n        }\n        else {\n            return cursorMin(ranges[0].anchor, ranges[0].head);\n        }\n    },\n    yank: function (cm, args, ranges, oldAnchor) {\n        var vim = cm.state.vim;\n        var text = cm.getSelection();\n        var endPos = vim.visualMode\n            ? cursorMin(vim.sel.anchor, vim.sel.head, ranges[0].head, ranges[0].anchor)\n            : oldAnchor;\n        vimGlobalState.registerController.pushText(args.registerName, 'yank', text, args.linewise, vim.visualBlock);\n        return endPos;\n    }\n};\nfunction defineOperator(name, fn) {\n    operators[name] = fn;\n}\nvar actions = {\n    jumpListWalk: function (cm, actionArgs, vim) {\n        if (vim.visualMode) {\n            return;\n        }\n        var repeat = actionArgs.repeat;\n        var forward = actionArgs.forward;\n        var jumpList = vimGlobalState.jumpList;\n        var mark = jumpList.move(cm, forward ? repeat : -repeat);\n        var markPos = mark ? mark.find() : undefined;\n        markPos = markPos ? markPos : cm.getCursor();\n        cm.setCursor(markPos);\n        cm.ace.curOp.command.scrollIntoView = \"center-animate\"; // ace_patch\n    },\n    scroll: function (cm, actionArgs, vim) {\n        if (vim.visualMode) {\n            return;\n        }\n        var repeat = actionArgs.repeat || 1;\n        var lineHeight = cm.defaultTextHeight();\n        var top = cm.getScrollInfo().top;\n        var delta = lineHeight * repeat;\n        var newPos = actionArgs.forward ? top + delta : top - delta;\n        var cursor = copyCursor(cm.getCursor());\n        var cursorCoords = cm.charCoords(cursor, 'local');\n        if (actionArgs.forward) {\n            if (newPos > cursorCoords.top) {\n                cursor.line += (newPos - cursorCoords.top) / lineHeight;\n                cursor.line = Math.ceil(cursor.line);\n                cm.setCursor(cursor);\n                cursorCoords = cm.charCoords(cursor, 'local');\n                cm.scrollTo(null, cursorCoords.top);\n            }\n            else {\n                cm.scrollTo(null, newPos);\n            }\n        }\n        else {\n            var newBottom = newPos + cm.getScrollInfo().clientHeight;\n            if (newBottom < cursorCoords.bottom) {\n                cursor.line -= (cursorCoords.bottom - newBottom) / lineHeight;\n                cursor.line = Math.floor(cursor.line);\n                cm.setCursor(cursor);\n                cursorCoords = cm.charCoords(cursor, 'local');\n                cm.scrollTo(null, cursorCoords.bottom - cm.getScrollInfo().clientHeight);\n            }\n            else {\n                cm.scrollTo(null, newPos);\n            }\n        }\n    },\n    scrollToCursor: function (cm, actionArgs) {\n        var lineNum = cm.getCursor().line;\n        var charCoords = cm.charCoords(new Pos(lineNum, 0), 'local');\n        var height = cm.getScrollInfo().clientHeight;\n        var y = charCoords.top;\n        switch (actionArgs.position) {\n            case 'center':\n                y = charCoords.bottom - height / 2;\n                break;\n            case 'bottom':\n                var lineLastCharPos = new Pos(lineNum, cm.getLine(lineNum).length - 1);\n                var lineLastCharCoords = cm.charCoords(lineLastCharPos, 'local');\n                var lineHeight = lineLastCharCoords.bottom - y;\n                y = y - height + lineHeight;\n                break;\n        }\n        cm.scrollTo(null, y);\n    },\n    replayMacro: function (cm, actionArgs, vim) {\n        var registerName = actionArgs.selectedCharacter;\n        var repeat = actionArgs.repeat;\n        var macroModeState = vimGlobalState.macroModeState;\n        if (registerName == '@') {\n            registerName = macroModeState.latestRegister;\n        }\n        else {\n            macroModeState.latestRegister = registerName;\n        }\n        while (repeat--) {\n            executeMacroRegister(cm, vim, macroModeState, registerName);\n        }\n    },\n    enterMacroRecordMode: function (cm, actionArgs) {\n        var macroModeState = vimGlobalState.macroModeState;\n        var registerName = actionArgs.selectedCharacter;\n        if (vimGlobalState.registerController.isValidRegister(registerName)) {\n            macroModeState.enterMacroRecordMode(cm, registerName);\n        }\n    },\n    toggleOverwrite: function (cm) {\n        if (!cm.state.overwrite) {\n            cm.toggleOverwrite(true);\n            cm.setOption('keyMap', 'vim-replace');\n            CodeMirror.signal(cm, \"vim-mode-change\", { mode: \"replace\" });\n        }\n        else {\n            cm.toggleOverwrite(false);\n            cm.setOption('keyMap', 'vim-insert');\n            CodeMirror.signal(cm, \"vim-mode-change\", { mode: \"insert\" });\n        }\n    },\n    enterInsertMode: function (cm, actionArgs, vim) {\n        if (cm.getOption('readOnly')) {\n            return;\n        }\n        vim.insertMode = true;\n        vim.insertModeRepeat = actionArgs && actionArgs.repeat || 1;\n        var insertAt = (actionArgs) ? actionArgs.insertAt : null;\n        var sel = vim.sel;\n        var head = actionArgs.head || cm.getCursor('head');\n        var height = cm.listSelections().length;\n        if (insertAt == 'eol') {\n            head = new Pos(head.line, lineLength(cm, head.line));\n        }\n        else if (insertAt == 'bol') {\n            head = new Pos(head.line, 0);\n        }\n        else if (insertAt == 'charAfter') {\n            var newPosition = updateSelectionForSurrogateCharacters(cm, head, offsetCursor(head, 0, 1));\n            head = newPosition.end;\n        }\n        else if (insertAt == 'firstNonBlank') {\n            var newPosition = updateSelectionForSurrogateCharacters(cm, head, motions.moveToFirstNonWhiteSpaceCharacter(cm, head));\n            head = newPosition.end;\n        }\n        else if (insertAt == 'startOfSelectedArea') {\n            if (!vim.visualMode)\n                return;\n            if (!vim.visualBlock) {\n                if (sel.head.line < sel.anchor.line) {\n                    head = sel.head;\n                }\n                else {\n                    head = new Pos(sel.anchor.line, 0);\n                }\n            }\n            else {\n                head = new Pos(Math.min(sel.head.line, sel.anchor.line), Math.min(sel.head.ch, sel.anchor.ch));\n                height = Math.abs(sel.head.line - sel.anchor.line) + 1;\n            }\n        }\n        else if (insertAt == 'endOfSelectedArea') {\n            if (!vim.visualMode)\n                return;\n            if (!vim.visualBlock) {\n                if (sel.head.line >= sel.anchor.line) {\n                    head = offsetCursor(sel.head, 0, 1);\n                }\n                else {\n                    head = new Pos(sel.anchor.line, 0);\n                }\n            }\n            else {\n                head = new Pos(Math.min(sel.head.line, sel.anchor.line), Math.max(sel.head.ch, sel.anchor.ch) + 1);\n                height = Math.abs(sel.head.line - sel.anchor.line) + 1;\n            }\n        }\n        else if (insertAt == 'inplace') {\n            if (vim.visualMode) {\n                return;\n            }\n        }\n        else if (insertAt == 'lastEdit') {\n            head = getLastEditPos(cm) || head;\n        }\n        cm.setOption('disableInput', false);\n        if (actionArgs && actionArgs.replace) {\n            cm.toggleOverwrite(true);\n            cm.setOption('keyMap', 'vim-replace');\n            CodeMirror.signal(cm, \"vim-mode-change\", { mode: \"replace\" });\n        }\n        else {\n            cm.toggleOverwrite(false);\n            cm.setOption('keyMap', 'vim-insert');\n            CodeMirror.signal(cm, \"vim-mode-change\", { mode: \"insert\" });\n        }\n        if (!vimGlobalState.macroModeState.isPlaying) {\n            cm.on('change', onChange);\n            if (vim.insertEnd)\n                vim.insertEnd.clear();\n            vim.insertEnd = cm.setBookmark(head, { insertLeft: true });\n            CodeMirror.on(cm.getInputField(), 'keydown', onKeyEventTargetKeyDown);\n        }\n        if (vim.visualMode) {\n            exitVisualMode(cm);\n        }\n        selectForInsert(cm, head, height);\n    },\n    toggleVisualMode: function (cm, actionArgs, vim) {\n        var repeat = actionArgs.repeat;\n        var anchor = cm.getCursor();\n        var head;\n        if (!vim.visualMode) {\n            vim.visualMode = true;\n            vim.visualLine = !!actionArgs.linewise;\n            vim.visualBlock = !!actionArgs.blockwise;\n            head = clipCursorToContent(cm, new Pos(anchor.line, anchor.ch + repeat - 1));\n            var newPosition = updateSelectionForSurrogateCharacters(cm, anchor, head);\n            vim.sel = {\n                anchor: newPosition.start,\n                head: newPosition.end\n            };\n            CodeMirror.signal(cm, \"vim-mode-change\", { mode: \"visual\", subMode: vim.visualLine ? \"linewise\" : vim.visualBlock ? \"blockwise\" : \"\" });\n            updateCmSelection(cm);\n            updateMark(cm, vim, '<', cursorMin(anchor, head));\n            updateMark(cm, vim, '>', cursorMax(anchor, head));\n        }\n        else if (vim.visualLine ^ actionArgs.linewise ||\n            vim.visualBlock ^ actionArgs.blockwise) {\n            vim.visualLine = !!actionArgs.linewise;\n            vim.visualBlock = !!actionArgs.blockwise;\n            CodeMirror.signal(cm, \"vim-mode-change\", { mode: \"visual\", subMode: vim.visualLine ? \"linewise\" : vim.visualBlock ? \"blockwise\" : \"\" });\n            updateCmSelection(cm);\n        }\n        else {\n            exitVisualMode(cm);\n        }\n    },\n    reselectLastSelection: function (cm, _actionArgs, vim) {\n        var lastSelection = vim.lastSelection;\n        if (vim.visualMode) {\n            updateLastSelection(cm, vim);\n        }\n        if (lastSelection) {\n            var anchor = lastSelection.anchorMark.find();\n            var head = lastSelection.headMark.find();\n            if (!anchor || !head) {\n                return;\n            }\n            vim.sel = {\n                anchor: anchor,\n                head: head\n            };\n            vim.visualMode = true;\n            vim.visualLine = lastSelection.visualLine;\n            vim.visualBlock = lastSelection.visualBlock;\n            updateCmSelection(cm);\n            updateMark(cm, vim, '<', cursorMin(anchor, head));\n            updateMark(cm, vim, '>', cursorMax(anchor, head));\n            CodeMirror.signal(cm, 'vim-mode-change', {\n                mode: 'visual',\n                subMode: vim.visualLine ? 'linewise' :\n                    vim.visualBlock ? 'blockwise' : ''\n            });\n        }\n    },\n    joinLines: function (cm, actionArgs, vim) {\n        var curStart, curEnd;\n        if (vim.visualMode) {\n            curStart = cm.getCursor('anchor');\n            curEnd = cm.getCursor('head');\n            if (cursorIsBefore(curEnd, curStart)) {\n                var tmp = curEnd;\n                curEnd = curStart;\n                curStart = tmp;\n            }\n            curEnd.ch = lineLength(cm, curEnd.line) - 1;\n        }\n        else {\n            var repeat = Math.max(actionArgs.repeat, 2);\n            curStart = cm.getCursor();\n            curEnd = clipCursorToContent(cm, new Pos(curStart.line + repeat - 1, Infinity));\n        }\n        var finalCh = 0;\n        for (var i = curStart.line; i < curEnd.line; i++) {\n            finalCh = lineLength(cm, curStart.line);\n            var text = '';\n            var nextStartCh = 0;\n            if (!actionArgs.keepSpaces) {\n                var nextLine = cm.getLine(curStart.line + 1);\n                nextStartCh = nextLine.search(/\\S/);\n                if (nextStartCh == -1) {\n                    nextStartCh = nextLine.length;\n                }\n                else {\n                    text = \" \";\n                }\n            }\n            cm.replaceRange(text, new Pos(curStart.line, finalCh), new Pos(curStart.line + 1, nextStartCh));\n        }\n        var curFinalPos = clipCursorToContent(cm, new Pos(curStart.line, finalCh));\n        if (vim.visualMode) {\n            exitVisualMode(cm, false);\n        }\n        cm.setCursor(curFinalPos);\n    },\n    newLineAndEnterInsertMode: function (cm, actionArgs, vim) {\n        vim.insertMode = true;\n        var insertAt = copyCursor(cm.getCursor());\n        if (insertAt.line === cm.firstLine() && !actionArgs.after) {\n            cm.replaceRange('\\n', new Pos(cm.firstLine(), 0));\n            cm.setCursor(cm.firstLine(), 0);\n        }\n        else {\n            insertAt.line = (actionArgs.after) ? insertAt.line :\n                insertAt.line - 1;\n            insertAt.ch = lineLength(cm, insertAt.line);\n            cm.setCursor(insertAt);\n            var newlineFn = CodeMirror.commands.newlineAndIndentContinueComment ||\n                CodeMirror.commands.newlineAndIndent;\n            newlineFn(cm);\n        }\n        this.enterInsertMode(cm, { repeat: actionArgs.repeat }, vim);\n    },\n    paste: function (cm, actionArgs, vim) {\n        var _this = this;\n        var register = vimGlobalState.registerController.getRegister(actionArgs.registerName);\n        var fallback = function () {\n            var text = register.toString();\n            _this.continuePaste(cm, actionArgs, vim, text, register);\n        };\n        if (actionArgs.registerName === '+' &&\n            typeof navigator !== 'undefined' &&\n            typeof navigator.clipboard !== 'undefined' &&\n            typeof navigator.clipboard.readText === 'function') {\n            navigator.clipboard.readText().then(function (value) {\n                _this.continuePaste(cm, actionArgs, vim, value, register);\n            }, function () { fallback(); });\n        }\n        else {\n            fallback();\n        }\n    },\n    continuePaste: function (cm, actionArgs, vim, text, register) {\n        var cur = copyCursor(cm.getCursor());\n        if (!text) {\n            return;\n        }\n        if (actionArgs.matchIndent) {\n            var tabSize = cm.getOption(\"tabSize\");\n            var whitespaceLength = function (str) {\n                var tabs = (str.split(\"\\t\").length - 1);\n                var spaces = (str.split(\" \").length - 1);\n                return tabs * tabSize + spaces * 1;\n            };\n            var currentLine = cm.getLine(cm.getCursor().line);\n            var indent = whitespaceLength(currentLine.match(/^\\s*/)[0]);\n            var chompedText = text.replace(/\\n$/, '');\n            var wasChomped = text !== chompedText;\n            var firstIndent = whitespaceLength(text.match(/^\\s*/)[0]);\n            var text = chompedText.replace(/^\\s*/gm, function (wspace) {\n                var newIndent = indent + (whitespaceLength(wspace) - firstIndent);\n                if (newIndent < 0) {\n                    return \"\";\n                }\n                else if (cm.getOption(\"indentWithTabs\")) {\n                    var quotient = Math.floor(newIndent / tabSize);\n                    return Array(quotient + 1).join('\\t');\n                }\n                else {\n                    return Array(newIndent + 1).join(' ');\n                }\n            });\n            text += wasChomped ? \"\\n\" : \"\";\n        }\n        if (actionArgs.repeat > 1) {\n            var text = Array(actionArgs.repeat + 1).join(text);\n        }\n        var linewise = register.linewise;\n        var blockwise = register.blockwise;\n        if (blockwise) {\n            text = text.split('\\n');\n            if (linewise) {\n                text.pop();\n            }\n            for (var i = 0; i < text.length; i++) {\n                text[i] = (text[i] == '') ? ' ' : text[i];\n            }\n            cur.ch += actionArgs.after ? 1 : 0;\n            cur.ch = Math.min(lineLength(cm, cur.line), cur.ch);\n        }\n        else if (linewise) {\n            if (vim.visualMode) {\n                text = vim.visualLine ? text.slice(0, -1) : '\\n' + text.slice(0, text.length - 1) + '\\n';\n            }\n            else if (actionArgs.after) {\n                text = '\\n' + text.slice(0, text.length - 1);\n                cur.ch = lineLength(cm, cur.line);\n            }\n            else {\n                cur.ch = 0;\n            }\n        }\n        else {\n            cur.ch += actionArgs.after ? 1 : 0;\n        }\n        var curPosFinal;\n        if (vim.visualMode) {\n            vim.lastPastedText = text;\n            var lastSelectionCurEnd;\n            var selectedArea = getSelectedAreaRange(cm, vim);\n            var selectionStart = selectedArea[0];\n            var selectionEnd = selectedArea[1];\n            var selectedText = cm.getSelection();\n            var selections = cm.listSelections();\n            var emptyStrings = new Array(selections.length).join('1').split('1');\n            if (vim.lastSelection) {\n                lastSelectionCurEnd = vim.lastSelection.headMark.find();\n            }\n            vimGlobalState.registerController.unnamedRegister.setText(selectedText);\n            if (blockwise) {\n                cm.replaceSelections(emptyStrings);\n                selectionEnd = new Pos(selectionStart.line + text.length - 1, selectionStart.ch);\n                cm.setCursor(selectionStart);\n                selectBlock(cm, selectionEnd);\n                cm.replaceSelections(text);\n                curPosFinal = selectionStart;\n            }\n            else if (vim.visualBlock) {\n                cm.replaceSelections(emptyStrings);\n                cm.setCursor(selectionStart);\n                cm.replaceRange(text, selectionStart, selectionStart);\n                curPosFinal = selectionStart;\n            }\n            else {\n                cm.replaceRange(text, selectionStart, selectionEnd);\n                curPosFinal = cm.posFromIndex(cm.indexFromPos(selectionStart) + text.length - 1);\n            }\n            if (lastSelectionCurEnd) {\n                vim.lastSelection.headMark = cm.setBookmark(lastSelectionCurEnd);\n            }\n            if (linewise) {\n                curPosFinal.ch = 0;\n            }\n        }\n        else {\n            if (blockwise) {\n                cm.setCursor(cur);\n                for (var i = 0; i < text.length; i++) {\n                    var line = cur.line + i;\n                    if (line > cm.lastLine()) {\n                        cm.replaceRange('\\n', new Pos(line, 0));\n                    }\n                    var lastCh = lineLength(cm, line);\n                    if (lastCh < cur.ch) {\n                        extendLineToColumn(cm, line, cur.ch);\n                    }\n                }\n                cm.setCursor(cur);\n                selectBlock(cm, new Pos(cur.line + text.length - 1, cur.ch));\n                cm.replaceSelections(text);\n                curPosFinal = cur;\n            }\n            else {\n                cm.replaceRange(text, cur);\n                if (linewise) {\n                    var line = actionArgs.after ? cur.line + 1 : cur.line;\n                    curPosFinal = new Pos(line, findFirstNonWhiteSpaceCharacter(cm.getLine(line)));\n                }\n                else {\n                    curPosFinal = copyCursor(cur);\n                    if (!/\\n/.test(text)) {\n                        curPosFinal.ch += text.length - (actionArgs.after ? 1 : 0);\n                    }\n                }\n            }\n        }\n        if (vim.visualMode) {\n            exitVisualMode(cm, false);\n        }\n        cm.setCursor(curPosFinal);\n    },\n    undo: function (cm, actionArgs) {\n        cm.operation(function () {\n            repeatFn(cm, CodeMirror.commands.undo, actionArgs.repeat)();\n            cm.setCursor(clipCursorToContent(cm, cm.getCursor('start')));\n        });\n    },\n    redo: function (cm, actionArgs) {\n        repeatFn(cm, CodeMirror.commands.redo, actionArgs.repeat)();\n    },\n    setRegister: function (_cm, actionArgs, vim) {\n        vim.inputState.registerName = actionArgs.selectedCharacter;\n    },\n    insertRegister: function (cm, actionArgs, vim) {\n        var registerName = actionArgs.selectedCharacter;\n        var register = vimGlobalState.registerController.getRegister(registerName);\n        var text = register && register.toString();\n        if (text) {\n            cm.replaceSelection(text);\n        }\n    },\n    oneNormalCommand: function (cm, actionArgs, vim) {\n        exitInsertMode(cm, true);\n        vim.insertModeReturn = true;\n        CodeMirror.on(cm, 'vim-command-done', function handler() {\n            if (vim.visualMode)\n                return;\n            if (vim.insertModeReturn) {\n                vim.insertModeReturn = false;\n                if (!vim.insertMode) {\n                    actions.enterInsertMode(cm, {}, vim);\n                }\n            }\n            CodeMirror.off(cm, 'vim-command-done', handler);\n        });\n    },\n    setMark: function (cm, actionArgs, vim) {\n        var markName = actionArgs.selectedCharacter;\n        updateMark(cm, vim, markName, cm.getCursor());\n    },\n    replace: function (cm, actionArgs, vim) {\n        var replaceWith = actionArgs.selectedCharacter;\n        var curStart = cm.getCursor();\n        var replaceTo;\n        var curEnd;\n        var selections = cm.listSelections();\n        if (vim.visualMode) {\n            curStart = cm.getCursor('start');\n            curEnd = cm.getCursor('end');\n        }\n        else {\n            var line = cm.getLine(curStart.line);\n            replaceTo = curStart.ch + actionArgs.repeat;\n            if (replaceTo > line.length) {\n                replaceTo = line.length;\n            }\n            curEnd = new Pos(curStart.line, replaceTo);\n        }\n        var newPositions = updateSelectionForSurrogateCharacters(cm, curStart, curEnd);\n        curStart = newPositions.start;\n        curEnd = newPositions.end;\n        if (replaceWith == '\\n') {\n            if (!vim.visualMode)\n                cm.replaceRange('', curStart, curEnd);\n            (CodeMirror.commands.newlineAndIndentContinueComment || CodeMirror.commands.newlineAndIndent)(cm);\n        }\n        else {\n            var replaceWithStr = cm.getRange(curStart, curEnd);\n            replaceWithStr = replaceWithStr.replace(/[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/g, replaceWith);\n            replaceWithStr = replaceWithStr.replace(/[^\\n]/g, replaceWith);\n            if (vim.visualBlock) {\n                var spaces = new Array(cm.getOption(\"tabSize\") + 1).join(' ');\n                replaceWithStr = cm.getSelection();\n                replaceWithStr = replaceWithStr.replace(/[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/g, replaceWith);\n                replaceWithStr = replaceWithStr.replace(/\\t/g, spaces).replace(/[^\\n]/g, replaceWith).split('\\n');\n                cm.replaceSelections(replaceWithStr);\n            }\n            else {\n                cm.replaceRange(replaceWithStr, curStart, curEnd);\n            }\n            if (vim.visualMode) {\n                curStart = cursorIsBefore(selections[0].anchor, selections[0].head) ?\n                    selections[0].anchor : selections[0].head;\n                cm.setCursor(curStart);\n                exitVisualMode(cm, false);\n            }\n            else {\n                cm.setCursor(offsetCursor(curEnd, 0, -1));\n            }\n        }\n    },\n    incrementNumberToken: function (cm, actionArgs) {\n        var cur = cm.getCursor();\n        var lineStr = cm.getLine(cur.line);\n        var re = /(-?)(?:(0x)([\\da-f]+)|(0b|0|)(\\d+))/gi;\n        var match;\n        var start;\n        var end;\n        var numberStr;\n        while ((match = re.exec(lineStr)) !== null) {\n            start = match.index;\n            end = start + match[0].length;\n            if (cur.ch < end)\n                break;\n        }\n        if (!actionArgs.backtrack && (end <= cur.ch))\n            return;\n        if (match) {\n            var baseStr = match[2] || match[4];\n            var digits = match[3] || match[5];\n            var increment = actionArgs.increase ? 1 : -1;\n            var base = { '0b': 2, '0': 8, '': 10, '0x': 16 }[baseStr.toLowerCase()];\n            var number = parseInt(match[1] + digits, base) + (increment * actionArgs.repeat);\n            numberStr = number.toString(base);\n            var zeroPadding = baseStr ? new Array(digits.length - numberStr.length + 1 + match[1].length).join('0') : '';\n            if (numberStr.charAt(0) === '-') {\n                numberStr = '-' + baseStr + zeroPadding + numberStr.substr(1);\n            }\n            else {\n                numberStr = baseStr + zeroPadding + numberStr;\n            }\n            var from = new Pos(cur.line, start);\n            var to = new Pos(cur.line, end);\n            cm.replaceRange(numberStr, from, to);\n        }\n        else {\n            return;\n        }\n        cm.setCursor(new Pos(cur.line, start + numberStr.length - 1));\n    },\n    repeatLastEdit: function (cm, actionArgs, vim) {\n        var lastEditInputState = vim.lastEditInputState;\n        if (!lastEditInputState) {\n            return;\n        }\n        var repeat = actionArgs.repeat;\n        if (repeat && actionArgs.repeatIsExplicit) {\n            vim.lastEditInputState.repeatOverride = repeat;\n        }\n        else {\n            repeat = vim.lastEditInputState.repeatOverride || repeat;\n        }\n        repeatLastEdit(cm, vim, repeat, false /** repeatForInsert */);\n    },\n    indent: function (cm, actionArgs) {\n        cm.indentLine(cm.getCursor().line, actionArgs.indentRight);\n    },\n    exitInsertMode: exitInsertMode\n};\nfunction defineAction(name, fn) {\n    actions[name] = fn;\n}\nfunction clipCursorToContent(cm, cur, oldCur) {\n    var vim = cm.state.vim;\n    var includeLineBreak = vim.insertMode || vim.visualMode;\n    var line = Math.min(Math.max(cm.firstLine(), cur.line), cm.lastLine());\n    var text = cm.getLine(line);\n    var maxCh = text.length - 1 + Number(!!includeLineBreak);\n    var ch = Math.min(Math.max(0, cur.ch), maxCh);\n    var charCode = text.charCodeAt(ch);\n    if (0xDC00 <= charCode && charCode <= 0xDFFF) {\n        var direction = 1;\n        if (oldCur && oldCur.line == line && oldCur.ch > ch) {\n            direction = -1;\n        }\n        ch += direction;\n        if (ch > maxCh)\n            ch -= 2;\n    }\n    return new Pos(line, ch);\n}\nfunction copyArgs(args) {\n    var ret = {};\n    for (var prop in args) {\n        if (args.hasOwnProperty(prop)) {\n            ret[prop] = args[prop];\n        }\n    }\n    return ret;\n}\nfunction offsetCursor(cur, offsetLine, offsetCh) {\n    if (typeof offsetLine === 'object') {\n        offsetCh = offsetLine.ch;\n        offsetLine = offsetLine.line;\n    }\n    return new Pos(cur.line + offsetLine, cur.ch + offsetCh);\n}\nfunction commandMatches(keys, keyMap, context, inputState) {\n    if (inputState.operator)\n        context = \"operatorPending\";\n    var match, partial = [], full = [];\n    var startIndex = noremap ? keyMap.length - defaultKeymapLength : 0;\n    for (var i = startIndex; i < keyMap.length; i++) {\n        var command = keyMap[i];\n        if (context == 'insert' && command.context != 'insert' ||\n            (command.context && command.context != context) ||\n            inputState.operator && command.type == 'action' ||\n            !(match = commandMatch(keys, command.keys))) {\n            continue;\n        }\n        if (match == 'partial') {\n            partial.push(command);\n        }\n        if (match == 'full') {\n            full.push(command);\n        }\n    }\n    return {\n        partial: partial.length && partial,\n        full: full.length && full\n    };\n}\nfunction commandMatch(pressed, mapped) {\n    var isLastCharacter = mapped.slice(-11) == '';\n    var isLastRegister = mapped.slice(-10) == '';\n    if (isLastCharacter || isLastRegister) {\n        var prefixLen = mapped.length - (isLastCharacter ? 11 : 10);\n        var pressedPrefix = pressed.slice(0, prefixLen);\n        var mappedPrefix = mapped.slice(0, prefixLen);\n        return pressedPrefix == mappedPrefix && pressed.length > prefixLen ? 'full' :\n            mappedPrefix.indexOf(pressedPrefix) == 0 ? 'partial' : false;\n    }\n    else {\n        return pressed == mapped ? 'full' :\n            mapped.indexOf(pressed) == 0 ? 'partial' : false;\n    }\n}\nfunction lastChar(keys) {\n    var match = /^.*(<[^>]+>)$/.exec(keys);\n    var selectedCharacter = match ? match[1] : keys.slice(-1);\n    if (selectedCharacter.length > 1) {\n        switch (selectedCharacter) {\n            case '':\n                selectedCharacter = '\\n';\n                break;\n            case '':\n                selectedCharacter = ' ';\n                break;\n            default:\n                selectedCharacter = '';\n                break;\n        }\n    }\n    return selectedCharacter;\n}\nfunction repeatFn(cm, fn, repeat) {\n    return function () {\n        for (var i = 0; i < repeat; i++) {\n            fn(cm);\n        }\n    };\n}\nfunction copyCursor(cur) {\n    return new Pos(cur.line, cur.ch);\n}\nfunction cursorEqual(cur1, cur2) {\n    return cur1.ch == cur2.ch && cur1.line == cur2.line;\n}\nfunction cursorIsBefore(cur1, cur2) {\n    if (cur1.line < cur2.line) {\n        return true;\n    }\n    if (cur1.line == cur2.line && cur1.ch < cur2.ch) {\n        return true;\n    }\n    return false;\n}\nfunction cursorMin(cur1, cur2) {\n    if (arguments.length > 2) {\n        cur2 = cursorMin.apply(undefined, Array.prototype.slice.call(arguments, 1));\n    }\n    return cursorIsBefore(cur1, cur2) ? cur1 : cur2;\n}\nfunction cursorMax(cur1, cur2) {\n    if (arguments.length > 2) {\n        cur2 = cursorMax.apply(undefined, Array.prototype.slice.call(arguments, 1));\n    }\n    return cursorIsBefore(cur1, cur2) ? cur2 : cur1;\n}\nfunction cursorIsBetween(cur1, cur2, cur3) {\n    var cur1before2 = cursorIsBefore(cur1, cur2);\n    var cur2before3 = cursorIsBefore(cur2, cur3);\n    return cur1before2 && cur2before3;\n}\nfunction lineLength(cm, lineNum) {\n    return cm.getLine(lineNum).length;\n}\nfunction trim(s) {\n    if (s.trim) {\n        return s.trim();\n    }\n    return s.replace(/^\\s+|\\s+$/g, '');\n}\nfunction escapeRegex(s) {\n    return s.replace(/([.?*+$\\[\\]\\/\\\\(){}|\\-])/g, '\\\\$1');\n}\nfunction extendLineToColumn(cm, lineNum, column) {\n    var endCh = lineLength(cm, lineNum);\n    var spaces = new Array(column - endCh + 1).join(' ');\n    cm.setCursor(new Pos(lineNum, endCh));\n    cm.replaceRange(spaces, cm.getCursor());\n}\nfunction selectBlock(cm, selectionEnd) {\n    var selections = [], ranges = cm.listSelections();\n    var head = copyCursor(cm.clipPos(selectionEnd));\n    var isClipped = !cursorEqual(selectionEnd, head);\n    var curHead = cm.getCursor('head');\n    var primIndex = getIndex(ranges, curHead);\n    var wasClipped = cursorEqual(ranges[primIndex].head, ranges[primIndex].anchor);\n    var max = ranges.length - 1;\n    var index = max - primIndex > primIndex ? max : 0;\n    var base = ranges[index].anchor;\n    var firstLine = Math.min(base.line, head.line);\n    var lastLine = Math.max(base.line, head.line);\n    var baseCh = base.ch, headCh = head.ch;\n    var dir = ranges[index].head.ch - baseCh;\n    var newDir = headCh - baseCh;\n    if (dir > 0 && newDir <= 0) {\n        baseCh++;\n        if (!isClipped) {\n            headCh--;\n        }\n    }\n    else if (dir < 0 && newDir >= 0) {\n        baseCh--;\n        if (!wasClipped) {\n            headCh++;\n        }\n    }\n    else if (dir < 0 && newDir == -1) {\n        baseCh--;\n        headCh++;\n    }\n    for (var line = firstLine; line <= lastLine; line++) {\n        var range = { anchor: new Pos(line, baseCh), head: new Pos(line, headCh) };\n        selections.push(range);\n    }\n    cm.setSelections(selections);\n    selectionEnd.ch = headCh;\n    base.ch = baseCh;\n    return base;\n}\nfunction selectForInsert(cm, head, height) {\n    var sel = [];\n    for (var i = 0; i < height; i++) {\n        var lineHead = offsetCursor(head, i, 0);\n        sel.push({ anchor: lineHead, head: lineHead });\n    }\n    cm.setSelections(sel, 0);\n}\nfunction getIndex(ranges, cursor, end) {\n    for (var i = 0; i < ranges.length; i++) {\n        var atAnchor = end != 'head' && cursorEqual(ranges[i].anchor, cursor);\n        var atHead = end != 'anchor' && cursorEqual(ranges[i].head, cursor);\n        if (atAnchor || atHead) {\n            return i;\n        }\n    }\n    return -1;\n}\nfunction getSelectedAreaRange(cm, vim) {\n    var lastSelection = vim.lastSelection;\n    var getCurrentSelectedAreaRange = function () {\n        var selections = cm.listSelections();\n        var start = selections[0];\n        var end = selections[selections.length - 1];\n        var selectionStart = cursorIsBefore(start.anchor, start.head) ? start.anchor : start.head;\n        var selectionEnd = cursorIsBefore(end.anchor, end.head) ? end.head : end.anchor;\n        return [selectionStart, selectionEnd];\n    };\n    var getLastSelectedAreaRange = function () {\n        var selectionStart = cm.getCursor();\n        var selectionEnd = cm.getCursor();\n        var block = lastSelection.visualBlock;\n        if (block) {\n            var width = block.width;\n            var height = block.height;\n            selectionEnd = new Pos(selectionStart.line + height, selectionStart.ch + width);\n            var selections = [];\n            for (var i = selectionStart.line; i < selectionEnd.line; i++) {\n                var anchor = new Pos(i, selectionStart.ch);\n                var head = new Pos(i, selectionEnd.ch);\n                var range = { anchor: anchor, head: head };\n                selections.push(range);\n            }\n            cm.setSelections(selections);\n        }\n        else {\n            var start = lastSelection.anchorMark.find();\n            var end = lastSelection.headMark.find();\n            var line = end.line - start.line;\n            var ch = end.ch - start.ch;\n            selectionEnd = { line: selectionEnd.line + line, ch: line ? selectionEnd.ch : ch + selectionEnd.ch };\n            if (lastSelection.visualLine) {\n                selectionStart = new Pos(selectionStart.line, 0);\n                selectionEnd = new Pos(selectionEnd.line, lineLength(cm, selectionEnd.line));\n            }\n            cm.setSelection(selectionStart, selectionEnd);\n        }\n        return [selectionStart, selectionEnd];\n    };\n    if (!vim.visualMode) {\n        return getLastSelectedAreaRange();\n    }\n    else {\n        return getCurrentSelectedAreaRange();\n    }\n}\nfunction updateLastSelection(cm, vim) {\n    var anchor = vim.sel.anchor;\n    var head = vim.sel.head;\n    if (vim.lastPastedText) {\n        head = cm.posFromIndex(cm.indexFromPos(anchor) + vim.lastPastedText.length);\n        vim.lastPastedText = null;\n    }\n    vim.lastSelection = { 'anchorMark': cm.setBookmark(anchor),\n        'headMark': cm.setBookmark(head),\n        'anchor': copyCursor(anchor),\n        'head': copyCursor(head),\n        'visualMode': vim.visualMode,\n        'visualLine': vim.visualLine,\n        'visualBlock': vim.visualBlock };\n}\nfunction expandSelection(cm, start, end, move) {\n    var sel = cm.state.vim.sel;\n    var head = move ? start : sel.head;\n    var anchor = move ? start : sel.anchor;\n    var tmp;\n    if (cursorIsBefore(end, start)) {\n        tmp = end;\n        end = start;\n        start = tmp;\n    }\n    if (cursorIsBefore(head, anchor)) {\n        head = cursorMin(start, head);\n        anchor = cursorMax(anchor, end);\n    }\n    else {\n        anchor = cursorMin(start, anchor);\n        head = cursorMax(head, end);\n        head = offsetCursor(head, 0, -1);\n        if (head.ch == -1 && head.line != cm.firstLine()) {\n            head = new Pos(head.line - 1, lineLength(cm, head.line - 1));\n        }\n    }\n    return [anchor, head];\n}\nfunction updateCmSelection(cm, sel, mode) {\n    var vim = cm.state.vim;\n    sel = sel || vim.sel;\n    var mode = mode ||\n        vim.visualLine ? 'line' : vim.visualBlock ? 'block' : 'char';\n    var cmSel = makeCmSelection(cm, sel, mode);\n    cm.setSelections(cmSel.ranges, cmSel.primary);\n}\nfunction makeCmSelection(cm, sel, mode, exclusive) {\n    var head = copyCursor(sel.head);\n    var anchor = copyCursor(sel.anchor);\n    if (mode == 'char') {\n        var headOffset = !exclusive && !cursorIsBefore(sel.head, sel.anchor) ? 1 : 0;\n        var anchorOffset = cursorIsBefore(sel.head, sel.anchor) ? 1 : 0;\n        head = offsetCursor(sel.head, 0, headOffset);\n        anchor = offsetCursor(sel.anchor, 0, anchorOffset);\n        return {\n            ranges: [{ anchor: anchor, head: head }],\n            primary: 0\n        };\n    }\n    else if (mode == 'line') {\n        if (!cursorIsBefore(sel.head, sel.anchor)) {\n            anchor.ch = 0;\n            var lastLine = cm.lastLine();\n            if (head.line > lastLine) {\n                head.line = lastLine;\n            }\n            head.ch = lineLength(cm, head.line);\n        }\n        else {\n            head.ch = 0;\n            anchor.ch = lineLength(cm, anchor.line);\n        }\n        return {\n            ranges: [{ anchor: anchor, head: head }],\n            primary: 0\n        };\n    }\n    else if (mode == 'block') {\n        var top = Math.min(anchor.line, head.line), fromCh = anchor.ch, bottom = Math.max(anchor.line, head.line), toCh = head.ch;\n        if (fromCh < toCh) {\n            toCh += 1;\n        }\n        else {\n            fromCh += 1;\n        }\n        ;\n        var height = bottom - top + 1;\n        var primary = head.line == top ? 0 : height - 1;\n        var ranges = [];\n        for (var i = 0; i < height; i++) {\n            ranges.push({\n                anchor: new Pos(top + i, fromCh),\n                head: new Pos(top + i, toCh)\n            });\n        }\n        return {\n            ranges: ranges,\n            primary: primary\n        };\n    }\n}\nfunction getHead(cm) {\n    var cur = cm.getCursor('head');\n    if (cm.getSelection().length == 1) {\n        cur = cursorMin(cur, cm.getCursor('anchor'));\n    }\n    return cur;\n}\nfunction exitVisualMode(cm, moveHead) {\n    var vim = cm.state.vim;\n    if (moveHead !== false) {\n        cm.setCursor(clipCursorToContent(cm, vim.sel.head));\n    }\n    updateLastSelection(cm, vim);\n    vim.visualMode = false;\n    vim.visualLine = false;\n    vim.visualBlock = false;\n    if (!vim.insertMode)\n        CodeMirror.signal(cm, \"vim-mode-change\", { mode: \"normal\" });\n}\nfunction clipToLine(cm, curStart, curEnd) {\n    var selection = cm.getRange(curStart, curEnd);\n    if (/\\n\\s*$/.test(selection)) {\n        var lines = selection.split('\\n');\n        lines.pop();\n        var line;\n        for (var line = lines.pop(); lines.length > 0 && line && isWhiteSpaceString(line); line = lines.pop()) {\n            curEnd.line--;\n            curEnd.ch = 0;\n        }\n        if (line) {\n            curEnd.line--;\n            curEnd.ch = lineLength(cm, curEnd.line);\n        }\n        else {\n            curEnd.ch = 0;\n        }\n    }\n}\nfunction expandSelectionToLine(_cm, curStart, curEnd) {\n    curStart.ch = 0;\n    curEnd.ch = 0;\n    curEnd.line++;\n}\nfunction findFirstNonWhiteSpaceCharacter(text) {\n    if (!text) {\n        return 0;\n    }\n    var firstNonWS = text.search(/\\S/);\n    return firstNonWS == -1 ? text.length : firstNonWS;\n}\nfunction expandWordUnderCursor(cm, _a, cursor) {\n    var inclusive = _a.inclusive, innerWord = _a.innerWord, bigWord = _a.bigWord, noSymbol = _a.noSymbol, multiline = _a.multiline;\n    var cur = cursor || getHead(cm);\n    var line = cm.getLine(cur.line);\n    var endLine = line;\n    var startLineNumber = cur.line;\n    var endLineNumber = startLineNumber;\n    var idx = cur.ch;\n    var wordOnNextLine;\n    var test = noSymbol ? wordCharTest[0] : bigWordCharTest[0];\n    if (innerWord && /\\s/.test(line.charAt(idx))) {\n        test = function (ch) { return /\\s/.test(ch); };\n    }\n    else {\n        while (!test(line.charAt(idx))) {\n            idx++;\n            if (idx >= line.length) {\n                if (!multiline)\n                    return null;\n                idx--;\n                wordOnNextLine = findWord(cm, cur, true, bigWord, true);\n                break;\n            }\n        }\n        if (bigWord) {\n            test = bigWordCharTest[0];\n        }\n        else {\n            test = wordCharTest[0];\n            if (!test(line.charAt(idx))) {\n                test = wordCharTest[1];\n            }\n        }\n    }\n    var end = idx, start = idx;\n    while (test(line.charAt(start)) && start >= 0) {\n        start--;\n    }\n    start++;\n    if (wordOnNextLine) {\n        end = wordOnNextLine.to;\n        endLineNumber = wordOnNextLine.line;\n        endLine = cm.getLine(endLineNumber);\n        if (!endLine && end == 0)\n            end++;\n    }\n    else {\n        while (test(line.charAt(end)) && end < line.length) {\n            end++;\n        }\n    }\n    if (inclusive) {\n        var wordEnd = end;\n        var startsWithSpace = cur.ch <= start && /\\s/.test(line.charAt(cur.ch));\n        if (!startsWithSpace) {\n            while (/\\s/.test(endLine.charAt(end)) && end < endLine.length) {\n                end++;\n            }\n        }\n        if (wordEnd == end || startsWithSpace) {\n            var wordStart = start;\n            while (/\\s/.test(line.charAt(start - 1)) && start > 0) {\n                start--;\n            }\n            if (!start && !startsWithSpace) {\n                start = wordStart;\n            }\n        }\n    }\n    return { start: new Pos(startLineNumber, start), end: new Pos(endLineNumber, end) };\n}\nfunction expandTagUnderCursor(cm, head, inclusive) {\n    var cur = head;\n    if (!CodeMirror.findMatchingTag || !CodeMirror.findEnclosingTag) {\n        return { start: cur, end: cur };\n    }\n    var tags = CodeMirror.findMatchingTag(cm, head) || CodeMirror.findEnclosingTag(cm, head);\n    if (!tags || !tags.open || !tags.close) {\n        return { start: cur, end: cur };\n    }\n    if (inclusive) {\n        return { start: tags.open.from, end: tags.close.to };\n    }\n    return { start: tags.open.to, end: tags.close.from };\n}\nfunction recordJumpPosition(cm, oldCur, newCur) {\n    if (!cursorEqual(oldCur, newCur)) {\n        vimGlobalState.jumpList.add(cm, oldCur, newCur);\n    }\n}\nfunction recordLastCharacterSearch(increment, args) {\n    vimGlobalState.lastCharacterSearch.increment = increment;\n    vimGlobalState.lastCharacterSearch.forward = args.forward;\n    vimGlobalState.lastCharacterSearch.selectedCharacter = args.selectedCharacter;\n}\nvar symbolToMode = {\n    '(': 'bracket', ')': 'bracket', '{': 'bracket', '}': 'bracket',\n    '[': 'section', ']': 'section',\n    '*': 'comment', '/': 'comment',\n    'm': 'method', 'M': 'method',\n    '#': 'preprocess'\n};\nvar findSymbolModes = {\n    bracket: {\n        isComplete: function (state) {\n            if (state.nextCh === state.symb) {\n                state.depth++;\n                if (state.depth >= 1)\n                    return true;\n            }\n            else if (state.nextCh === state.reverseSymb) {\n                state.depth--;\n            }\n            return false;\n        }\n    },\n    section: {\n        init: function (state) {\n            state.curMoveThrough = true;\n            state.symb = (state.forward ? ']' : '[') === state.symb ? '{' : '}';\n        },\n        isComplete: function (state) {\n            return state.index === 0 && state.nextCh === state.symb;\n        }\n    },\n    comment: {\n        isComplete: function (state) {\n            var found = state.lastCh === '*' && state.nextCh === '/';\n            state.lastCh = state.nextCh;\n            return found;\n        }\n    },\n    method: {\n        init: function (state) {\n            state.symb = (state.symb === 'm' ? '{' : '}');\n            state.reverseSymb = state.symb === '{' ? '}' : '{';\n        },\n        isComplete: function (state) {\n            if (state.nextCh === state.symb)\n                return true;\n            return false;\n        }\n    },\n    preprocess: {\n        init: function (state) {\n            state.index = 0;\n        },\n        isComplete: function (state) {\n            if (state.nextCh === '#') {\n                var token = state.lineText.match(/^#(\\w+)/)[1];\n                if (token === 'endif') {\n                    if (state.forward && state.depth === 0) {\n                        return true;\n                    }\n                    state.depth++;\n                }\n                else if (token === 'if') {\n                    if (!state.forward && state.depth === 0) {\n                        return true;\n                    }\n                    state.depth--;\n                }\n                if (token === 'else' && state.depth === 0)\n                    return true;\n            }\n            return false;\n        }\n    }\n};\nfunction findSymbol(cm, repeat, forward, symb) {\n    var cur = copyCursor(cm.getCursor());\n    var increment = forward ? 1 : -1;\n    var endLine = forward ? cm.lineCount() : -1;\n    var curCh = cur.ch;\n    var line = cur.line;\n    var lineText = cm.getLine(line);\n    var state = {\n        lineText: lineText,\n        nextCh: lineText.charAt(curCh),\n        lastCh: null,\n        index: curCh,\n        symb: symb,\n        reverseSymb: (forward ? { ')': '(', '}': '{' } : { '(': ')', '{': '}' })[symb],\n        forward: forward,\n        depth: 0,\n        curMoveThrough: false\n    };\n    var mode = symbolToMode[symb];\n    if (!mode)\n        return cur;\n    var init = findSymbolModes[mode].init;\n    var isComplete = findSymbolModes[mode].isComplete;\n    if (init) {\n        init(state);\n    }\n    while (line !== endLine && repeat) {\n        state.index += increment;\n        state.nextCh = state.lineText.charAt(state.index);\n        if (!state.nextCh) {\n            line += increment;\n            state.lineText = cm.getLine(line) || '';\n            if (increment > 0) {\n                state.index = 0;\n            }\n            else {\n                var lineLen = state.lineText.length;\n                state.index = (lineLen > 0) ? (lineLen - 1) : 0;\n            }\n            state.nextCh = state.lineText.charAt(state.index);\n        }\n        if (isComplete(state)) {\n            cur.line = line;\n            cur.ch = state.index;\n            repeat--;\n        }\n    }\n    if (state.nextCh || state.curMoveThrough) {\n        return new Pos(line, state.index);\n    }\n    return cur;\n}\nfunction findWord(cm, cur, forward, bigWord, emptyLineIsWord) {\n    var lineNum = cur.line;\n    var pos = cur.ch;\n    var line = cm.getLine(lineNum);\n    var dir = forward ? 1 : -1;\n    var charTests = bigWord ? bigWordCharTest : wordCharTest;\n    if (emptyLineIsWord && line == '') {\n        lineNum += dir;\n        line = cm.getLine(lineNum);\n        if (!isLine(cm, lineNum)) {\n            return null;\n        }\n        pos = (forward) ? 0 : line.length;\n    }\n    while (true) {\n        if (emptyLineIsWord && line == '') {\n            return { from: 0, to: 0, line: lineNum };\n        }\n        var stop = (dir > 0) ? line.length : -1;\n        var wordStart = stop, wordEnd = stop;\n        while (pos != stop) {\n            var foundWord = false;\n            for (var i = 0; i < charTests.length && !foundWord; ++i) {\n                if (charTests[i](line.charAt(pos))) {\n                    wordStart = pos;\n                    while (pos != stop && charTests[i](line.charAt(pos))) {\n                        pos += dir;\n                    }\n                    wordEnd = pos;\n                    foundWord = wordStart != wordEnd;\n                    if (wordStart == cur.ch && lineNum == cur.line &&\n                        wordEnd == wordStart + dir) {\n                        continue;\n                    }\n                    else {\n                        return {\n                            from: Math.min(wordStart, wordEnd + 1),\n                            to: Math.max(wordStart, wordEnd),\n                            line: lineNum\n                        };\n                    }\n                }\n            }\n            if (!foundWord) {\n                pos += dir;\n            }\n        }\n        lineNum += dir;\n        if (!isLine(cm, lineNum)) {\n            return null;\n        }\n        line = cm.getLine(lineNum);\n        pos = (dir > 0) ? 0 : line.length;\n    }\n}\nfunction moveToWord(cm, cur, repeat, forward, wordEnd, bigWord) {\n    var curStart = copyCursor(cur);\n    var words = [];\n    if (forward && !wordEnd || !forward && wordEnd) {\n        repeat++;\n    }\n    var emptyLineIsWord = !(forward && wordEnd);\n    for (var i = 0; i < repeat; i++) {\n        var word = findWord(cm, cur, forward, bigWord, emptyLineIsWord);\n        if (!word) {\n            var eodCh = lineLength(cm, cm.lastLine());\n            words.push(forward\n                ? { line: cm.lastLine(), from: eodCh, to: eodCh }\n                : { line: 0, from: 0, to: 0 });\n            break;\n        }\n        words.push(word);\n        cur = new Pos(word.line, forward ? (word.to - 1) : word.from);\n    }\n    var shortCircuit = words.length != repeat;\n    var firstWord = words[0];\n    var lastWord = words.pop();\n    if (forward && !wordEnd) {\n        if (!shortCircuit && (firstWord.from != curStart.ch || firstWord.line != curStart.line)) {\n            lastWord = words.pop();\n        }\n        return new Pos(lastWord.line, lastWord.from);\n    }\n    else if (forward && wordEnd) {\n        return new Pos(lastWord.line, lastWord.to - 1);\n    }\n    else if (!forward && wordEnd) {\n        if (!shortCircuit && (firstWord.to != curStart.ch || firstWord.line != curStart.line)) {\n            lastWord = words.pop();\n        }\n        return new Pos(lastWord.line, lastWord.to);\n    }\n    else {\n        return new Pos(lastWord.line, lastWord.from);\n    }\n}\nfunction moveToEol(cm, head, motionArgs, vim, keepHPos) {\n    var cur = head;\n    var retval = new Pos(cur.line + motionArgs.repeat - 1, Infinity);\n    var end = cm.clipPos(retval);\n    end.ch--;\n    if (!keepHPos) {\n        vim.lastHPos = Infinity;\n        vim.lastHSPos = cm.charCoords(end, 'div').left;\n    }\n    return retval;\n}\nfunction moveToCharacter(cm, repeat, forward, character, head) {\n    var cur = head || cm.getCursor();\n    var start = cur.ch;\n    var idx;\n    for (var i = 0; i < repeat; i++) {\n        var line = cm.getLine(cur.line);\n        idx = charIdxInLine(start, line, character, forward, true);\n        if (idx == -1) {\n            return null;\n        }\n        start = idx;\n    }\n    return new Pos(cm.getCursor().line, idx);\n}\nfunction moveToColumn(cm, repeat) {\n    var line = cm.getCursor().line;\n    return clipCursorToContent(cm, new Pos(line, repeat - 1));\n}\nfunction updateMark(cm, vim, markName, pos) {\n    if (!inArray(markName, validMarks) && !latinCharRegex.test(markName)) {\n        return;\n    }\n    if (vim.marks[markName]) {\n        vim.marks[markName].clear();\n    }\n    vim.marks[markName] = cm.setBookmark(pos);\n}\nfunction charIdxInLine(start, line, character, forward, includeChar) {\n    var idx;\n    if (forward) {\n        idx = line.indexOf(character, start + 1);\n        if (idx != -1 && !includeChar) {\n            idx -= 1;\n        }\n    }\n    else {\n        idx = line.lastIndexOf(character, start - 1);\n        if (idx != -1 && !includeChar) {\n            idx += 1;\n        }\n    }\n    return idx;\n}\nfunction findParagraph(cm, head, repeat, dir, inclusive) {\n    var line = head.line;\n    var min = cm.firstLine();\n    var max = cm.lastLine();\n    var start, end, i = line;\n    function isEmpty(i) { return !/\\S/.test(cm.getLine(i)); } // ace_patch\n    function isBoundary(i, dir, any) {\n        if (any) {\n            return isEmpty(i) != isEmpty(i + dir);\n        }\n        return !isEmpty(i) && isEmpty(i + dir);\n    }\n    function skipFold(i) {\n        dir = dir > 0 ? 1 : -1;\n        var foldLine = cm.ace.session.getFoldLine(i);\n        if (foldLine) {\n            if (i + dir > foldLine.start.row && i + dir < foldLine.end.row)\n                dir = (dir > 0 ? foldLine.end.row : foldLine.start.row) - i;\n        }\n    }\n    if (dir) {\n        while (min <= i && i <= max && repeat > 0) {\n            skipFold(i);\n            if (isBoundary(i, dir)) {\n                repeat--;\n            }\n            i += dir;\n        }\n        return new Pos(i, 0);\n    }\n    var vim = cm.state.vim;\n    if (vim.visualLine && isBoundary(line, 1, true)) {\n        var anchor = vim.sel.anchor;\n        if (isBoundary(anchor.line, -1, true)) {\n            if (!inclusive || anchor.line != line) {\n                line += 1;\n            }\n        }\n    }\n    var startState = isEmpty(line);\n    for (i = line; i <= max && repeat; i++) {\n        if (isBoundary(i, 1, true)) {\n            if (!inclusive || isEmpty(i) != startState) {\n                repeat--;\n            }\n        }\n    }\n    end = new Pos(i, 0);\n    if (i > max && !startState) {\n        startState = true;\n    }\n    else {\n        inclusive = false;\n    }\n    for (i = line; i > min; i--) {\n        if (!inclusive || isEmpty(i) == startState || i == line) {\n            if (isBoundary(i, -1, true)) {\n                break;\n            }\n        }\n    }\n    start = new Pos(i, 0);\n    return { start: start, end: end };\n}\nfunction getSentence(cm, cur, repeat, dir, inclusive /*includes whitespace*/) {\n    function nextChar(curr) {\n        if (curr.pos + curr.dir < 0 || curr.pos + curr.dir >= curr.line.length) {\n            curr.line = null;\n        }\n        else {\n            curr.pos += curr.dir;\n        }\n    }\n    function forward(cm, ln, pos, dir) {\n        var line = cm.getLine(ln);\n        var curr = {\n            line: line,\n            ln: ln,\n            pos: pos,\n            dir: dir,\n        };\n        if (curr.line === \"\") {\n            return { ln: curr.ln, pos: curr.pos };\n        }\n        var lastSentencePos = curr.pos;\n        nextChar(curr);\n        while (curr.line !== null) {\n            lastSentencePos = curr.pos;\n            if (isEndOfSentenceSymbol(curr.line[curr.pos])) {\n                if (!inclusive) {\n                    return { ln: curr.ln, pos: curr.pos + 1 };\n                }\n                else {\n                    nextChar(curr);\n                    while (curr.line !== null) {\n                        if (isWhiteSpaceString(curr.line[curr.pos])) {\n                            lastSentencePos = curr.pos;\n                            nextChar(curr);\n                        }\n                        else {\n                            break;\n                        }\n                    }\n                    return { ln: curr.ln, pos: lastSentencePos + 1 };\n                }\n            }\n            nextChar(curr);\n        }\n        return { ln: curr.ln, pos: lastSentencePos + 1 };\n    }\n    function reverse(cm, ln, pos, dir) {\n        var line = cm.getLine(ln);\n        var curr = {\n            line: line,\n            ln: ln,\n            pos: pos,\n            dir: dir,\n        };\n        if (curr.line === \"\") {\n            return { ln: curr.ln, pos: curr.pos };\n        }\n        var lastSentencePos = curr.pos;\n        nextChar(curr);\n        while (curr.line !== null) {\n            if (!isWhiteSpaceString(curr.line[curr.pos]) && !isEndOfSentenceSymbol(curr.line[curr.pos])) {\n                lastSentencePos = curr.pos;\n            }\n            else if (isEndOfSentenceSymbol(curr.line[curr.pos])) {\n                if (!inclusive) {\n                    return { ln: curr.ln, pos: lastSentencePos };\n                }\n                else {\n                    if (isWhiteSpaceString(curr.line[curr.pos + 1])) {\n                        return { ln: curr.ln, pos: curr.pos + 1 };\n                    }\n                    else {\n                        return { ln: curr.ln, pos: lastSentencePos };\n                    }\n                }\n            }\n            nextChar(curr);\n        }\n        curr.line = line;\n        if (inclusive && isWhiteSpaceString(curr.line[curr.pos])) {\n            return { ln: curr.ln, pos: curr.pos };\n        }\n        else {\n            return { ln: curr.ln, pos: lastSentencePos };\n        }\n    }\n    var curr_index = {\n        ln: cur.line,\n        pos: cur.ch,\n    };\n    while (repeat > 0) {\n        if (dir < 0) {\n            curr_index = reverse(cm, curr_index.ln, curr_index.pos, dir);\n        }\n        else {\n            curr_index = forward(cm, curr_index.ln, curr_index.pos, dir);\n        }\n        repeat--;\n    }\n    return new Pos(curr_index.ln, curr_index.pos);\n}\nfunction findSentence(cm, cur, repeat, dir) {\n    function nextChar(cm, idx) {\n        if (idx.pos + idx.dir < 0 || idx.pos + idx.dir >= idx.line.length) {\n            idx.ln += idx.dir;\n            if (!isLine(cm, idx.ln)) {\n                idx.line = null;\n                idx.ln = null;\n                idx.pos = null;\n                return;\n            }\n            idx.line = cm.getLine(idx.ln);\n            idx.pos = (idx.dir > 0) ? 0 : idx.line.length - 1;\n        }\n        else {\n            idx.pos += idx.dir;\n        }\n    }\n    function forward(cm, ln, pos, dir) {\n        var line = cm.getLine(ln);\n        var stop = (line === \"\");\n        var curr = {\n            line: line,\n            ln: ln,\n            pos: pos,\n            dir: dir,\n        };\n        var last_valid = {\n            ln: curr.ln,\n            pos: curr.pos,\n        };\n        var skip_empty_lines = (curr.line === \"\");\n        nextChar(cm, curr);\n        while (curr.line !== null) {\n            last_valid.ln = curr.ln;\n            last_valid.pos = curr.pos;\n            if (curr.line === \"\" && !skip_empty_lines) {\n                return { ln: curr.ln, pos: curr.pos, };\n            }\n            else if (stop && curr.line !== \"\" && !isWhiteSpaceString(curr.line[curr.pos])) {\n                return { ln: curr.ln, pos: curr.pos, };\n            }\n            else if (isEndOfSentenceSymbol(curr.line[curr.pos])\n                && !stop\n                && (curr.pos === curr.line.length - 1\n                    || isWhiteSpaceString(curr.line[curr.pos + 1]))) {\n                stop = true;\n            }\n            nextChar(cm, curr);\n        }\n        var line = cm.getLine(last_valid.ln);\n        last_valid.pos = 0;\n        for (var i = line.length - 1; i >= 0; --i) {\n            if (!isWhiteSpaceString(line[i])) {\n                last_valid.pos = i;\n                break;\n            }\n        }\n        return last_valid;\n    }\n    function reverse(cm, ln, pos, dir) {\n        var line = cm.getLine(ln);\n        var curr = {\n            line: line,\n            ln: ln,\n            pos: pos,\n            dir: dir,\n        };\n        var last_valid = {\n            ln: curr.ln,\n            pos: null,\n        };\n        var skip_empty_lines = (curr.line === \"\");\n        nextChar(cm, curr);\n        while (curr.line !== null) {\n            if (curr.line === \"\" && !skip_empty_lines) {\n                if (last_valid.pos !== null) {\n                    return last_valid;\n                }\n                else {\n                    return { ln: curr.ln, pos: curr.pos };\n                }\n            }\n            else if (isEndOfSentenceSymbol(curr.line[curr.pos])\n                && last_valid.pos !== null\n                && !(curr.ln === last_valid.ln && curr.pos + 1 === last_valid.pos)) {\n                return last_valid;\n            }\n            else if (curr.line !== \"\" && !isWhiteSpaceString(curr.line[curr.pos])) {\n                skip_empty_lines = false;\n                last_valid = { ln: curr.ln, pos: curr.pos };\n            }\n            nextChar(cm, curr);\n        }\n        var line = cm.getLine(last_valid.ln);\n        last_valid.pos = 0;\n        for (var i = 0; i < line.length; ++i) {\n            if (!isWhiteSpaceString(line[i])) {\n                last_valid.pos = i;\n                break;\n            }\n        }\n        return last_valid;\n    }\n    var curr_index = {\n        ln: cur.line,\n        pos: cur.ch,\n    };\n    while (repeat > 0) {\n        if (dir < 0) {\n            curr_index = reverse(cm, curr_index.ln, curr_index.pos, dir);\n        }\n        else {\n            curr_index = forward(cm, curr_index.ln, curr_index.pos, dir);\n        }\n        repeat--;\n    }\n    return new Pos(curr_index.ln, curr_index.pos);\n}\nfunction selectCompanionObject(cm, head, symb, inclusive) {\n    var cur = head, start, end;\n    var bracketRegexp = ({\n        '(': /[()]/, ')': /[()]/,\n        '[': /[[\\]]/, ']': /[[\\]]/,\n        '{': /[{}]/, '}': /[{}]/,\n        '<': /[<>]/, '>': /[<>]/\n    })[symb];\n    var openSym = ({\n        '(': '(', ')': '(',\n        '[': '[', ']': '[',\n        '{': '{', '}': '{',\n        '<': '<', '>': '<'\n    })[symb];\n    var curChar = cm.getLine(cur.line).charAt(cur.ch);\n    var offset = curChar === openSym ? 1 : 0;\n    start = cm.scanForBracket(new Pos(cur.line, cur.ch + offset), -1, undefined, { 'bracketRegex': bracketRegexp });\n    end = cm.scanForBracket(new Pos(cur.line, cur.ch + offset), 1, undefined, { 'bracketRegex': bracketRegexp });\n    if (!start || !end)\n        return null;\n    start = start.pos;\n    end = end.pos;\n    if ((start.line == end.line && start.ch > end.ch)\n        || (start.line > end.line)) {\n        var tmp = start;\n        start = end;\n        end = tmp;\n    }\n    if (inclusive) {\n        end.ch += 1;\n    }\n    else {\n        start.ch += 1;\n    }\n    return { start: start, end: end };\n}\nfunction findBeginningAndEnd(cm, head, symb, inclusive) {\n    var cur = copyCursor(head);\n    var line = cm.getLine(cur.line);\n    var chars = line.split('');\n    var start, end, i, len;\n    var firstIndex = chars.indexOf(symb);\n    if (cur.ch < firstIndex) {\n        cur.ch = firstIndex;\n    }\n    else if (firstIndex < cur.ch && chars[cur.ch] == symb) {\n        var stringAfter = /string/.test(cm.getTokenTypeAt(offsetCursor(head, 0, 1)));\n        var stringBefore = /string/.test(cm.getTokenTypeAt(head));\n        var isStringStart = stringAfter && !stringBefore;\n        if (!isStringStart) {\n            end = cur.ch; // assign end to the current cursor\n            --cur.ch; // make sure to look backwards\n        }\n    }\n    if (chars[cur.ch] == symb && !end) {\n        start = cur.ch + 1; // assign start to ahead of the cursor\n    }\n    else {\n        for (i = cur.ch; i > -1 && !start; i--) {\n            if (chars[i] == symb) {\n                start = i + 1;\n            }\n        }\n    }\n    if (start && !end) {\n        for (i = start, len = chars.length; i < len && !end; i++) {\n            if (chars[i] == symb) {\n                end = i;\n            }\n        }\n    }\n    if (!start || !end) {\n        return { start: cur, end: cur };\n    }\n    if (inclusive) {\n        --start;\n        ++end;\n    }\n    return {\n        start: new Pos(cur.line, start),\n        end: new Pos(cur.line, end)\n    };\n}\ndefineOption('pcre', true, 'boolean');\nfunction SearchState() { }\nSearchState.prototype = {\n    getQuery: function () {\n        return vimGlobalState.query;\n    },\n    setQuery: function (query) {\n        vimGlobalState.query = query;\n    },\n    getOverlay: function () {\n        return this.searchOverlay;\n    },\n    setOverlay: function (overlay) {\n        this.searchOverlay = overlay;\n    },\n    isReversed: function () {\n        return vimGlobalState.isReversed;\n    },\n    setReversed: function (reversed) {\n        vimGlobalState.isReversed = reversed;\n    },\n    getScrollbarAnnotate: function () {\n        return this.annotate;\n    },\n    setScrollbarAnnotate: function (annotate) {\n        this.annotate = annotate;\n    }\n};\nfunction getSearchState(cm) {\n    var vim = cm.state.vim;\n    return vim.searchState_ || (vim.searchState_ = new SearchState());\n}\nfunction splitBySlash(argString) {\n    return splitBySeparator(argString, '/');\n}\nfunction findUnescapedSlashes(argString) {\n    return findUnescapedSeparators(argString, '/');\n}\nfunction splitBySeparator(argString, separator) {\n    var slashes = findUnescapedSeparators(argString, separator) || [];\n    if (!slashes.length)\n        return [];\n    var tokens = [];\n    if (slashes[0] !== 0)\n        return;\n    for (var i = 0; i < slashes.length; i++) {\n        if (typeof slashes[i] == 'number')\n            tokens.push(argString.substring(slashes[i] + 1, slashes[i + 1]));\n    }\n    return tokens;\n}\nfunction findUnescapedSeparators(str, separator) {\n    if (!separator)\n        separator = '/';\n    var escapeNextChar = false;\n    var slashes = [];\n    for (var i = 0; i < str.length; i++) {\n        var c = str.charAt(i);\n        if (!escapeNextChar && c == separator) {\n            slashes.push(i);\n        }\n        escapeNextChar = !escapeNextChar && (c == '\\\\');\n    }\n    return slashes;\n}\nfunction translateRegex(str) {\n    var specials = '|(){';\n    var unescape = '}';\n    var escapeNextChar = false;\n    var out = [];\n    for (var i = -1; i < str.length; i++) {\n        var c = str.charAt(i) || '';\n        var n = str.charAt(i + 1) || '';\n        var specialComesNext = (n && specials.indexOf(n) != -1);\n        if (escapeNextChar) {\n            if (c !== '\\\\' || !specialComesNext) {\n                out.push(c);\n            }\n            escapeNextChar = false;\n        }\n        else {\n            if (c === '\\\\') {\n                escapeNextChar = true;\n                if (n && unescape.indexOf(n) != -1) {\n                    specialComesNext = true;\n                }\n                if (!specialComesNext || n === '\\\\') {\n                    out.push(c);\n                }\n            }\n            else {\n                out.push(c);\n                if (specialComesNext && n !== '\\\\') {\n                    out.push('\\\\');\n                }\n            }\n        }\n    }\n    return out.join('');\n}\nvar charUnescapes = { '\\\\n': '\\n', '\\\\r': '\\r', '\\\\t': '\\t' };\nfunction translateRegexReplace(str) {\n    var escapeNextChar = false;\n    var out = [];\n    for (var i = -1; i < str.length; i++) {\n        var c = str.charAt(i) || '';\n        var n = str.charAt(i + 1) || '';\n        if (charUnescapes[c + n]) {\n            out.push(charUnescapes[c + n]);\n            i++;\n        }\n        else if (escapeNextChar) {\n            out.push(c);\n            escapeNextChar = false;\n        }\n        else {\n            if (c === '\\\\') {\n                escapeNextChar = true;\n                if ((isNumber(n) || n === '$')) {\n                    out.push('$');\n                }\n                else if (n !== '/' && n !== '\\\\') {\n                    out.push('\\\\');\n                }\n            }\n            else {\n                if (c === '$') {\n                    out.push('$');\n                }\n                out.push(c);\n                if (n === '/') {\n                    out.push('\\\\');\n                }\n            }\n        }\n    }\n    return out.join('');\n}\nvar unescapes = { '\\\\/': '/', '\\\\\\\\': '\\\\', '\\\\n': '\\n', '\\\\r': '\\r', '\\\\t': '\\t', '\\\\&': '&' };\nfunction unescapeRegexReplace(str) {\n    var stream = new CodeMirror.StringStream(str);\n    var output = [];\n    while (!stream.eol()) {\n        while (stream.peek() && stream.peek() != '\\\\') {\n            output.push(stream.next());\n        }\n        var matched = false;\n        for (var matcher in unescapes) {\n            if (stream.match(matcher, true)) {\n                matched = true;\n                output.push(unescapes[matcher]);\n                break;\n            }\n        }\n        if (!matched) {\n            output.push(stream.next());\n        }\n    }\n    return output.join('');\n}\nfunction parseQuery(query, ignoreCase, smartCase) {\n    var lastSearchRegister = vimGlobalState.registerController.getRegister('/');\n    lastSearchRegister.setText(query);\n    if (query instanceof RegExp) {\n        return query;\n    }\n    var slashes = findUnescapedSlashes(query);\n    var regexPart;\n    var forceIgnoreCase;\n    if (!slashes.length) {\n        regexPart = query;\n    }\n    else {\n        regexPart = query.substring(0, slashes[0]);\n        var flagsPart = query.substring(slashes[0]);\n        forceIgnoreCase = (flagsPart.indexOf('i') != -1);\n    }\n    if (!regexPart) {\n        return null;\n    }\n    if (!getOption('pcre')) {\n        regexPart = translateRegex(regexPart);\n    }\n    if (smartCase) {\n        ignoreCase = (/^[^A-Z]*$/).test(regexPart);\n    }\n    var regexp = new RegExp(regexPart, (ignoreCase || forceIgnoreCase) ? 'im' : 'm');\n    return regexp;\n}\nfunction dom(n) {\n    if (typeof n === 'string')\n        n = document.createElement(n);\n    for (var a, i = 1; i < arguments.length; i++) {\n        if (!(a = arguments[i]))\n            continue;\n        if (typeof a !== 'object')\n            a = document.createTextNode(a);\n        if (a.nodeType)\n            n.appendChild(a);\n        else\n            for (var key in a) {\n                if (!Object.prototype.hasOwnProperty.call(a, key))\n                    continue;\n                if (key[0] === '$')\n                    n.style[key.slice(1)] = a[key];\n                else\n                    n.setAttribute(key, a[key]);\n            }\n    }\n    return n;\n}\nfunction showConfirm(cm, template) {\n    var pre = dom('div', { $color: 'red', $whiteSpace: 'pre', class: 'cm-vim-message' }, template);\n    if (cm.openNotification) {\n        cm.openNotification(pre, { bottom: true, duration: 5000 });\n    }\n    else {\n        alert(pre.innerText);\n    }\n}\nfunction makePrompt(prefix, desc) {\n    return dom('div', { $display: 'flex' }, dom('span', { $fontFamily: 'monospace', $whiteSpace: 'pre', $flex: 1 }, prefix, dom('input', { type: 'text', autocorrect: 'off',\n        autocapitalize: 'off', spellcheck: 'false', $width: '100%' })), desc && dom('span', { $color: '#888' }, desc));\n}\nfunction showPrompt(cm, options) {\n    if (keyToKeyStack.length) {\n        if (!options.value)\n            options.value = '';\n        virtualPrompt = options;\n        return;\n    }\n    var template = makePrompt(options.prefix, options.desc);\n    if (cm.openDialog) {\n        cm.openDialog(template, options.onClose, {\n            onKeyDown: options.onKeyDown, onKeyUp: options.onKeyUp,\n            bottom: true, selectValueOnOpen: false, value: options.value\n        });\n    }\n    else {\n        var shortText = '';\n        if (typeof options.prefix != \"string\" && options.prefix)\n            shortText += options.prefix.textContent;\n        if (options.desc)\n            shortText += \" \" + options.desc;\n        options.onClose(prompt(shortText, ''));\n    }\n}\nfunction regexEqual(r1, r2) {\n    if (r1 instanceof RegExp && r2 instanceof RegExp) {\n        var props = ['global', 'multiline', 'ignoreCase', 'source'];\n        for (var i = 0; i < props.length; i++) {\n            var prop = props[i];\n            if (r1[prop] !== r2[prop]) {\n                return false;\n            }\n        }\n        return true;\n    }\n    return false;\n}\nfunction updateSearchQuery(cm, rawQuery, ignoreCase, smartCase) {\n    if (!rawQuery) {\n        return;\n    }\n    var state = getSearchState(cm);\n    var query = parseQuery(rawQuery, !!ignoreCase, !!smartCase);\n    if (!query) {\n        return;\n    }\n    highlightSearchMatches(cm, query);\n    if (regexEqual(query, state.getQuery())) {\n        return query;\n    }\n    state.setQuery(query);\n    return query;\n}\nfunction searchOverlay(query) {\n    if (query.source.charAt(0) == '^') {\n        var matchSol = true;\n    }\n    return {\n        token: function (stream) {\n            if (matchSol && !stream.sol()) {\n                stream.skipToEnd();\n                return;\n            }\n            var match = stream.match(query, false);\n            if (match) {\n                if (match[0].length == 0) {\n                    stream.next();\n                    return 'searching';\n                }\n                if (!stream.sol()) {\n                    stream.backUp(1);\n                    if (!query.exec(stream.next() + match[0])) {\n                        stream.next();\n                        return null;\n                    }\n                }\n                stream.match(query);\n                return 'searching';\n            }\n            while (!stream.eol()) {\n                stream.next();\n                if (stream.match(query, false))\n                    break;\n            }\n        },\n        query: query\n    };\n}\nvar highlightTimeout = 0;\nfunction highlightSearchMatches(cm, query) {\n    clearTimeout(highlightTimeout);\n    var searchState = getSearchState(cm);\n    searchState.highlightTimeout = highlightTimeout;\n    highlightTimeout = setTimeout(function () {\n        if (!cm.state.vim)\n            return;\n        var searchState = getSearchState(cm);\n        searchState.highlightTimeout = null;\n        var overlay = searchState.getOverlay();\n        if (!overlay || query != overlay.query) {\n            if (overlay) {\n                cm.removeOverlay(overlay);\n            }\n            overlay = searchOverlay(query);\n            cm.addOverlay(overlay);\n            if (cm.showMatchesOnScrollbar) {\n                if (searchState.getScrollbarAnnotate()) {\n                    searchState.getScrollbarAnnotate().clear();\n                }\n                searchState.setScrollbarAnnotate(cm.showMatchesOnScrollbar(query));\n            }\n            searchState.setOverlay(overlay);\n        }\n    }, 50);\n}\nfunction findNext(cm, prev, query, repeat) {\n    if (repeat === undefined) {\n        repeat = 1;\n    }\n    return cm.operation(function () {\n        var pos = cm.getCursor();\n        var cursor = cm.getSearchCursor(query, pos);\n        for (var i = 0; i < repeat; i++) {\n            var found = cursor.find(prev);\n            if (i == 0 && found && cursorEqual(cursor.from(), pos)) {\n                var lastEndPos = prev ? cursor.from() : cursor.to();\n                found = cursor.find(prev);\n                if (found && !found[0] && cursorEqual(cursor.from(), lastEndPos)) {\n                    if (cm.getLine(lastEndPos.line).length == lastEndPos.ch)\n                        found = cursor.find(prev);\n                }\n            }\n            if (!found) {\n                cursor = cm.getSearchCursor(query, (prev) ? new Pos(cm.lastLine()) : new Pos(cm.firstLine(), 0));\n                if (!cursor.find(prev)) {\n                    return;\n                }\n            }\n        }\n        return cursor.from();\n    });\n}\nfunction findNextFromAndToInclusive(cm, prev, query, repeat, vim) {\n    if (repeat === undefined) {\n        repeat = 1;\n    }\n    return cm.operation(function () {\n        var pos = cm.getCursor();\n        var cursor = cm.getSearchCursor(query, pos);\n        var found = cursor.find(!prev);\n        if (!vim.visualMode && found && cursorEqual(cursor.from(), pos)) {\n            cursor.find(!prev);\n        }\n        for (var i = 0; i < repeat; i++) {\n            found = cursor.find(prev);\n            if (!found) {\n                cursor = cm.getSearchCursor(query, (prev) ? new Pos(cm.lastLine()) : new Pos(cm.firstLine(), 0));\n                if (!cursor.find(prev)) {\n                    return;\n                }\n            }\n        }\n        return [cursor.from(), cursor.to()];\n    });\n}\nfunction clearSearchHighlight(cm) {\n    var state = getSearchState(cm);\n    if (state.highlightTimeout) {\n        clearTimeout(state.highlightTimeout);\n        state.highlightTimeout = null;\n    }\n    cm.removeOverlay(getSearchState(cm).getOverlay());\n    state.setOverlay(null);\n    if (state.getScrollbarAnnotate()) {\n        state.getScrollbarAnnotate().clear();\n        state.setScrollbarAnnotate(null);\n    }\n}\nfunction isInRange(pos, start, end) {\n    if (typeof pos != 'number') {\n        pos = pos.line;\n    }\n    if (start instanceof Array) {\n        return inArray(pos, start);\n    }\n    else {\n        if (typeof end == 'number') {\n            return (pos >= start && pos <= end);\n        }\n        else {\n            return pos == start;\n        }\n    }\n}\nfunction getUserVisibleLines(cm) {\n    var renderer = cm.ace.renderer;\n    return {\n        top: renderer.getFirstFullyVisibleRow(),\n        bottom: renderer.getLastFullyVisibleRow()\n    };\n}\nfunction getMarkPos(cm, vim, markName) {\n    if (markName == '\\'' || markName == '`') {\n        return vimGlobalState.jumpList.find(cm, -1) || new Pos(0, 0);\n    }\n    else if (markName == '.') {\n        return getLastEditPos(cm);\n    }\n    var mark = vim.marks[markName];\n    return mark && mark.find();\n}\nfunction getLastEditPos(cm) {\n    if (cm.getLastEditEnd) {\n        return cm.getLastEditEnd();\n    }\n    var done = cm.doc.history.done;\n    for (var i = done.length; i--;) {\n        if (done[i].changes) {\n            return copyCursor(done[i].changes[0].to);\n        }\n    }\n}\nvar ExCommandDispatcher = function () {\n    this.buildCommandMap_();\n};\nExCommandDispatcher.prototype = {\n    processCommand: function (cm, input, opt_params) {\n        var that = this;\n        cm.operation(function () {\n            cm.curOp.isVimOp = true;\n            that._processCommand(cm, input, opt_params);\n        });\n    },\n    _processCommand: function (cm, input, opt_params) {\n        var vim = cm.state.vim;\n        var commandHistoryRegister = vimGlobalState.registerController.getRegister(':');\n        var previousCommand = commandHistoryRegister.toString();\n        var inputStream = new CodeMirror.StringStream(input);\n        commandHistoryRegister.setText(input);\n        var params = opt_params || {};\n        params.input = input;\n        try {\n            this.parseInput_(cm, inputStream, params);\n        }\n        catch (e) {\n            showConfirm(cm, e.toString());\n            throw e;\n        }\n        if (vim.visualMode) {\n            exitVisualMode(cm);\n        }\n        var command;\n        var commandName;\n        if (!params.commandName) {\n            if (params.line !== undefined) {\n                commandName = 'move';\n            }\n        }\n        else {\n            command = this.matchCommand_(params.commandName);\n            if (command) {\n                commandName = command.name;\n                if (command.excludeFromCommandHistory) {\n                    commandHistoryRegister.setText(previousCommand);\n                }\n                this.parseCommandArgs_(inputStream, params, command);\n                if (command.type == 'exToKey') {\n                    doKeyToKey(cm, command.toKeys, command);\n                    return;\n                }\n                else if (command.type == 'exToEx') {\n                    this.processCommand(cm, command.toInput);\n                    return;\n                }\n            }\n        }\n        if (!commandName) {\n            showConfirm(cm, 'Not an editor command \":' + input + '\"');\n            return;\n        }\n        try {\n            exCommands[commandName](cm, params);\n            if ((!command || !command.possiblyAsync) && params.callback) {\n                params.callback();\n            }\n        }\n        catch (e) {\n            showConfirm(cm, e.toString());\n            throw e;\n        }\n    },\n    parseInput_: function (cm, inputStream, result) {\n        inputStream.eatWhile(':');\n        if (inputStream.eat('%')) {\n            result.line = cm.firstLine();\n            result.lineEnd = cm.lastLine();\n        }\n        else {\n            result.line = this.parseLineSpec_(cm, inputStream);\n            if (result.line !== undefined && inputStream.eat(',')) {\n                result.lineEnd = this.parseLineSpec_(cm, inputStream);\n            }\n        }\n        if (result.line == undefined) {\n            if (cm.state.vim.visualMode) {\n                var pos = getMarkPos(cm, cm.state.vim, '<');\n                result.selectionLine = pos && pos.line;\n                pos = getMarkPos(cm, cm.state.vim, '>');\n                result.selectionLineEnd = pos && pos.line;\n            }\n            else {\n                result.selectionLine = cm.getCursor().line;\n            }\n        }\n        else {\n            result.selectionLine = result.line;\n            result.selectionLineEnd = result.lineEnd;\n        }\n        var commandMatch = inputStream.match(/^(\\w+|!!|@@|[!#&*<=>@~])/);\n        if (commandMatch) {\n            result.commandName = commandMatch[1];\n        }\n        else {\n            result.commandName = inputStream.match(/.*/)[0];\n        }\n        return result;\n    },\n    parseLineSpec_: function (cm, inputStream) {\n        var numberMatch = inputStream.match(/^(\\d+)/);\n        if (numberMatch) {\n            return parseInt(numberMatch[1], 10) - 1;\n        }\n        switch (inputStream.next()) {\n            case '.':\n                return this.parseLineSpecOffset_(inputStream, cm.getCursor().line);\n            case '$':\n                return this.parseLineSpecOffset_(inputStream, cm.lastLine());\n            case '\\'':\n                var markName = inputStream.next();\n                var markPos = getMarkPos(cm, cm.state.vim, markName);\n                if (!markPos)\n                    throw new Error('Mark not set');\n                return this.parseLineSpecOffset_(inputStream, markPos.line);\n            case '-':\n            case '+':\n                inputStream.backUp(1);\n                return this.parseLineSpecOffset_(inputStream, cm.getCursor().line);\n            default:\n                inputStream.backUp(1);\n                return undefined;\n        }\n    },\n    parseLineSpecOffset_: function (inputStream, line) {\n        var offsetMatch = inputStream.match(/^([+-])?(\\d+)/);\n        if (offsetMatch) {\n            var offset = parseInt(offsetMatch[2], 10);\n            if (offsetMatch[1] == \"-\") {\n                line -= offset;\n            }\n            else {\n                line += offset;\n            }\n        }\n        return line;\n    },\n    parseCommandArgs_: function (inputStream, params, command) {\n        if (inputStream.eol()) {\n            return;\n        }\n        params.argString = inputStream.match(/.*/)[0];\n        var delim = command.argDelimiter || /\\s+/;\n        var args = trim(params.argString).split(delim);\n        if (args.length && args[0]) {\n            params.args = args;\n        }\n    },\n    matchCommand_: function (commandName) {\n        for (var i = commandName.length; i > 0; i--) {\n            var prefix = commandName.substring(0, i);\n            if (this.commandMap_[prefix]) {\n                var command = this.commandMap_[prefix];\n                if (command.name.indexOf(commandName) === 0) {\n                    return command;\n                }\n            }\n        }\n        return null;\n    },\n    buildCommandMap_: function () {\n        this.commandMap_ = {};\n        for (var i = 0; i < defaultExCommandMap.length; i++) {\n            var command = defaultExCommandMap[i];\n            var key = command.shortName || command.name;\n            this.commandMap_[key] = command;\n        }\n    },\n    map: function (lhs, rhs, ctx, noremap) {\n        if (lhs != ':' && lhs.charAt(0) == ':') {\n            if (ctx) {\n                throw Error('Mode not supported for ex mappings');\n            }\n            var commandName = lhs.substring(1);\n            if (rhs != ':' && rhs.charAt(0) == ':') {\n                this.commandMap_[commandName] = {\n                    name: commandName,\n                    type: 'exToEx',\n                    toInput: rhs.substring(1),\n                    user: true\n                };\n            }\n            else {\n                this.commandMap_[commandName] = {\n                    name: commandName,\n                    type: 'exToKey',\n                    toKeys: rhs,\n                    user: true\n                };\n            }\n        }\n        else {\n            var mapping = {\n                keys: lhs,\n                type: 'keyToKey',\n                toKeys: rhs,\n                noremap: !!noremap\n            };\n            if (ctx) {\n                mapping.context = ctx;\n            }\n            defaultKeymap.unshift(mapping);\n        }\n    },\n    unmap: function (lhs, ctx) {\n        if (lhs != ':' && lhs.charAt(0) == ':') {\n            if (ctx) {\n                throw Error('Mode not supported for ex mappings');\n            }\n            var commandName = lhs.substring(1);\n            if (this.commandMap_[commandName] && this.commandMap_[commandName].user) {\n                delete this.commandMap_[commandName];\n                return true;\n            }\n        }\n        else {\n            var keys = lhs;\n            for (var i = 0; i < defaultKeymap.length; i++) {\n                if (keys == defaultKeymap[i].keys\n                    && defaultKeymap[i].context === ctx) {\n                    defaultKeymap.splice(i, 1);\n                    return true;\n                }\n            }\n        }\n    }\n};\nvar exCommands = {\n    colorscheme: function (cm, params) {\n        if (!params.args || params.args.length < 1) {\n            showConfirm(cm, cm.getOption('theme'));\n            return;\n        }\n        cm.setOption('theme', params.args[0]);\n    },\n    map: function (cm, params, ctx, defaultOnly) {\n        var mapArgs = params.args;\n        if (!mapArgs || mapArgs.length < 2) {\n            if (cm) {\n                showConfirm(cm, 'Invalid mapping: ' + params.input);\n            }\n            return;\n        }\n        exCommandDispatcher.map(mapArgs[0], mapArgs[1], ctx, defaultOnly);\n    },\n    imap: function (cm, params) { this.map(cm, params, 'insert'); },\n    nmap: function (cm, params) { this.map(cm, params, 'normal'); },\n    vmap: function (cm, params) { this.map(cm, params, 'visual'); },\n    omap: function (cm, params) { this.map(cm, params, 'operatorPending'); },\n    noremap: function (cm, params) { this.map(cm, params, undefined, true); },\n    inoremap: function (cm, params) { this.map(cm, params, 'insert', true); },\n    nnoremap: function (cm, params) { this.map(cm, params, 'normal', true); },\n    vnoremap: function (cm, params) { this.map(cm, params, 'visual', true); },\n    onoremap: function (cm, params) { this.map(cm, params, 'operatorPending', true); },\n    unmap: function (cm, params, ctx) {\n        var mapArgs = params.args;\n        if (!mapArgs || mapArgs.length < 1 || !exCommandDispatcher.unmap(mapArgs[0], ctx)) {\n            if (cm) {\n                showConfirm(cm, 'No such mapping: ' + params.input);\n            }\n        }\n    },\n    mapclear: function (cm, params) { vimApi.mapclear(); },\n    imapclear: function (cm, params) { vimApi.mapclear('insert'); },\n    nmapclear: function (cm, params) { vimApi.mapclear('normal'); },\n    vmapclear: function (cm, params) { vimApi.mapclear('visual'); },\n    omapclear: function (cm, params) { vimApi.mapclear('operatorPending'); },\n    move: function (cm, params) {\n        commandDispatcher.processCommand(cm, cm.state.vim, {\n            type: 'motion',\n            motion: 'moveToLineOrEdgeOfDocument',\n            motionArgs: { forward: false, explicitRepeat: true,\n                linewise: true },\n            repeatOverride: params.line + 1\n        });\n    },\n    set: function (cm, params) {\n        var setArgs = params.args;\n        var setCfg = params.setCfg || {};\n        if (!setArgs || setArgs.length < 1) {\n            if (cm) {\n                showConfirm(cm, 'Invalid mapping: ' + params.input);\n            }\n            return;\n        }\n        var expr = setArgs[0].split('=');\n        var optionName = expr[0];\n        var value = expr[1];\n        var forceGet = false;\n        var forceToggle = false;\n        if (optionName.charAt(optionName.length - 1) == '?') {\n            if (value) {\n                throw Error('Trailing characters: ' + params.argString);\n            }\n            optionName = optionName.substring(0, optionName.length - 1);\n            forceGet = true;\n        }\n        else if (optionName.charAt(optionName.length - 1) == '!') {\n            optionName = optionName.substring(0, optionName.length - 1);\n            forceToggle = true;\n        }\n        if (value === undefined && optionName.substring(0, 2) == 'no') {\n            optionName = optionName.substring(2);\n            value = false;\n        }\n        var optionIsBoolean = options[optionName] && options[optionName].type == 'boolean';\n        if (optionIsBoolean) {\n            if (forceToggle) {\n                value = !getOption(optionName, cm, setCfg);\n            }\n            else if (value == undefined) {\n                value = true;\n            }\n        }\n        if (!optionIsBoolean && value === undefined || forceGet) {\n            var oldValue = getOption(optionName, cm, setCfg);\n            if (oldValue instanceof Error) {\n                showConfirm(cm, oldValue.message);\n            }\n            else if (oldValue === true || oldValue === false) {\n                showConfirm(cm, ' ' + (oldValue ? '' : 'no') + optionName);\n            }\n            else {\n                showConfirm(cm, '  ' + optionName + '=' + oldValue);\n            }\n        }\n        else {\n            var setOptionReturn = setOption(optionName, value, cm, setCfg);\n            if (setOptionReturn instanceof Error) {\n                showConfirm(cm, setOptionReturn.message);\n            }\n        }\n    },\n    setlocal: function (cm, params) {\n        params.setCfg = { scope: 'local' };\n        this.set(cm, params);\n    },\n    setglobal: function (cm, params) {\n        params.setCfg = { scope: 'global' };\n        this.set(cm, params);\n    },\n    registers: function (cm, params) {\n        var regArgs = params.args;\n        var registers = vimGlobalState.registerController.registers;\n        var regInfo = '----------Registers----------\\n\\n';\n        if (!regArgs) {\n            for (var registerName in registers) {\n                var text = registers[registerName].toString();\n                if (text.length) {\n                    regInfo += '\"' + registerName + '    ' + text + '\\n';\n                }\n            }\n        }\n        else {\n            var registerName;\n            regArgs = regArgs.join('');\n            for (var i = 0; i < regArgs.length; i++) {\n                registerName = regArgs.charAt(i);\n                if (!vimGlobalState.registerController.isValidRegister(registerName)) {\n                    continue;\n                }\n                var register = registers[registerName] || new Register();\n                regInfo += '\"' + registerName + '    ' + register.toString() + '\\n';\n            }\n        }\n        showConfirm(cm, regInfo);\n    },\n    sort: function (cm, params) {\n        var reverse, ignoreCase, unique, number, pattern;\n        function parseArgs() {\n            if (params.argString) {\n                var args = new CodeMirror.StringStream(params.argString);\n                if (args.eat('!')) {\n                    reverse = true;\n                }\n                if (args.eol()) {\n                    return;\n                }\n                if (!args.eatSpace()) {\n                    return 'Invalid arguments';\n                }\n                var opts = args.match(/([dinuox]+)?\\s*(\\/.+\\/)?\\s*/);\n                if (!opts && !args.eol()) {\n                    return 'Invalid arguments';\n                }\n                if (opts[1]) {\n                    ignoreCase = opts[1].indexOf('i') != -1;\n                    unique = opts[1].indexOf('u') != -1;\n                    var decimal = opts[1].indexOf('d') != -1 || opts[1].indexOf('n') != -1 && 1;\n                    var hex = opts[1].indexOf('x') != -1 && 1;\n                    var octal = opts[1].indexOf('o') != -1 && 1;\n                    if (decimal + hex + octal > 1) {\n                        return 'Invalid arguments';\n                    }\n                    number = decimal && 'decimal' || hex && 'hex' || octal && 'octal';\n                }\n                if (opts[2]) {\n                    pattern = new RegExp(opts[2].substr(1, opts[2].length - 2), ignoreCase ? 'i' : '');\n                }\n            }\n        }\n        var err = parseArgs();\n        if (err) {\n            showConfirm(cm, err + ': ' + params.argString);\n            return;\n        }\n        var lineStart = params.line || cm.firstLine();\n        var lineEnd = params.lineEnd || params.line || cm.lastLine();\n        if (lineStart == lineEnd) {\n            return;\n        }\n        var curStart = new Pos(lineStart, 0);\n        var curEnd = new Pos(lineEnd, lineLength(cm, lineEnd));\n        var text = cm.getRange(curStart, curEnd).split('\\n');\n        var numberRegex = pattern ? pattern :\n            (number == 'decimal') ? /(-?)([\\d]+)/ :\n                (number == 'hex') ? /(-?)(?:0x)?([0-9a-f]+)/i :\n                    (number == 'octal') ? /([0-7]+)/ : null;\n        var radix = (number == 'decimal') ? 10 : (number == 'hex') ? 16 : (number == 'octal') ? 8 : null;\n        var numPart = [], textPart = [];\n        if (number || pattern) {\n            for (var i = 0; i < text.length; i++) {\n                var matchPart = pattern ? text[i].match(pattern) : null;\n                if (matchPart && matchPart[0] != '') {\n                    numPart.push(matchPart);\n                }\n                else if (!pattern && numberRegex.exec(text[i])) {\n                    numPart.push(text[i]);\n                }\n                else {\n                    textPart.push(text[i]);\n                }\n            }\n        }\n        else {\n            textPart = text;\n        }\n        function compareFn(a, b) {\n            if (reverse) {\n                var tmp;\n                tmp = a;\n                a = b;\n                b = tmp;\n            }\n            if (ignoreCase) {\n                a = a.toLowerCase();\n                b = b.toLowerCase();\n            }\n            var anum = number && numberRegex.exec(a);\n            var bnum = number && numberRegex.exec(b);\n            if (!anum) {\n                return a < b ? -1 : 1;\n            }\n            anum = parseInt((anum[1] + anum[2]).toLowerCase(), radix);\n            bnum = parseInt((bnum[1] + bnum[2]).toLowerCase(), radix);\n            return anum - bnum;\n        }\n        function comparePatternFn(a, b) {\n            if (reverse) {\n                var tmp;\n                tmp = a;\n                a = b;\n                b = tmp;\n            }\n            if (ignoreCase) {\n                a[0] = a[0].toLowerCase();\n                b[0] = b[0].toLowerCase();\n            }\n            return (a[0] < b[0]) ? -1 : 1;\n        }\n        numPart.sort(pattern ? comparePatternFn : compareFn);\n        if (pattern) {\n            for (var i = 0; i < numPart.length; i++) {\n                numPart[i] = numPart[i].input;\n            }\n        }\n        else if (!number) {\n            textPart.sort(compareFn);\n        }\n        text = (!reverse) ? textPart.concat(numPart) : numPart.concat(textPart);\n        if (unique) { // Remove duplicate lines\n            var textOld = text;\n            var lastLine;\n            text = [];\n            for (var i = 0; i < textOld.length; i++) {\n                if (textOld[i] != lastLine) {\n                    text.push(textOld[i]);\n                }\n                lastLine = textOld[i];\n            }\n        }\n        cm.replaceRange(text.join('\\n'), curStart, curEnd);\n    },\n    vglobal: function (cm, params) {\n        this.global(cm, params);\n    },\n    normal: function (cm, params) {\n        var argString = params.argString;\n        if (argString && argString[0] == '!') {\n            argString = argString.slice(1);\n            noremap = true;\n        }\n        argString = argString.trimStart();\n        if (!argString) {\n            showConfirm(cm, 'Argument is required.');\n            return;\n        }\n        var line = params.line;\n        if (typeof line == 'number') {\n            var lineEnd = isNaN(params.lineEnd) ? line : params.lineEnd;\n            for (var i = line; i <= lineEnd; i++) {\n                cm.setCursor(i, 0);\n                doKeyToKey(cm, params.argString.trimStart());\n                if (cm.state.vim.insertMode) {\n                    exitInsertMode(cm, true);\n                }\n            }\n        }\n        else {\n            doKeyToKey(cm, params.argString.trimStart());\n            if (cm.state.vim.insertMode) {\n                exitInsertMode(cm, true);\n            }\n        }\n    },\n    global: function (cm, params) {\n        var argString = params.argString;\n        if (!argString) {\n            showConfirm(cm, 'Regular Expression missing from global');\n            return;\n        }\n        var inverted = params.commandName[0] === 'v';\n        if (argString[0] === '!' && params.commandName[0] === 'g') {\n            inverted = true;\n            argString = argString.slice(1);\n        }\n        var lineStart = (params.line !== undefined) ? params.line : cm.firstLine();\n        var lineEnd = params.lineEnd || params.line || cm.lastLine();\n        var tokens = splitBySlash(argString);\n        var regexPart = argString, cmd;\n        if (tokens.length) {\n            regexPart = tokens[0];\n            cmd = tokens.slice(1, tokens.length).join('/');\n        }\n        if (regexPart) {\n            try {\n                updateSearchQuery(cm, regexPart, true /** ignoreCase */, true /** smartCase */);\n            }\n            catch (e) {\n                showConfirm(cm, 'Invalid regex: ' + regexPart);\n                return;\n            }\n        }\n        var query = getSearchState(cm).getQuery();\n        var matchedLines = [];\n        for (var i = lineStart; i <= lineEnd; i++) {\n            var line = cm.getLine(i);\n            var matched = query.test(line);\n            if (matched !== inverted) {\n                matchedLines.push(cmd ? cm.getLineHandle(i) : line);\n            }\n        }\n        if (!cmd) {\n            showConfirm(cm, matchedLines.join('\\n'));\n            return;\n        }\n        var index = 0;\n        var nextCommand = function () {\n            if (index < matchedLines.length) {\n                var lineHandle = matchedLines[index++];\n                var lineNum = cm.getLineNumber(lineHandle);\n                if (lineNum == null) {\n                    nextCommand();\n                    return;\n                }\n                var command = (lineNum + 1) + cmd;\n                exCommandDispatcher.processCommand(cm, command, {\n                    callback: nextCommand\n                });\n            }\n            else if (cm.releaseLineHandles) {\n                cm.releaseLineHandles();\n            }\n        };\n        nextCommand();\n    },\n    substitute: function (cm, params) {\n        if (!cm.getSearchCursor) {\n            throw new Error('Search feature not available. Requires searchcursor.js or ' +\n                'any other getSearchCursor implementation.');\n        }\n        var argString = params.argString;\n        var tokens = argString ? splitBySeparator(argString, argString[0]) : [];\n        var regexPart, replacePart = '', trailing, flagsPart, count;\n        var confirm = false; // Whether to confirm each replace.\n        var global = false; // True to replace all instances on a line, false to replace only 1.\n        if (tokens.length) {\n            regexPart = tokens[0];\n            if (getOption('pcre') && regexPart !== '') {\n                regexPart = new RegExp(regexPart).source; //normalize not escaped characters\n            }\n            replacePart = tokens[1];\n            if (replacePart !== undefined) {\n                if (getOption('pcre')) {\n                    replacePart = unescapeRegexReplace(replacePart.replace(/([^\\\\])&/g, \"$1$$&\"));\n                }\n                else {\n                    replacePart = translateRegexReplace(replacePart);\n                }\n                vimGlobalState.lastSubstituteReplacePart = replacePart;\n            }\n            trailing = tokens[2] ? tokens[2].split(' ') : [];\n        }\n        else {\n            if (argString && argString.length) {\n                showConfirm(cm, 'Substitutions should be of the form ' +\n                    ':s/pattern/replace/');\n                return;\n            }\n        }\n        if (trailing) {\n            flagsPart = trailing[0];\n            count = parseInt(trailing[1]);\n            if (flagsPart) {\n                if (flagsPart.indexOf('c') != -1) {\n                    confirm = true;\n                }\n                if (flagsPart.indexOf('g') != -1) {\n                    global = true;\n                }\n                if (getOption('pcre')) {\n                    regexPart = regexPart + '/' + flagsPart;\n                }\n                else {\n                    regexPart = regexPart.replace(/\\//g, \"\\\\/\") + '/' + flagsPart;\n                }\n            }\n        }\n        if (regexPart) {\n            try {\n                updateSearchQuery(cm, regexPart, true /** ignoreCase */, true /** smartCase */);\n            }\n            catch (e) {\n                showConfirm(cm, 'Invalid regex: ' + regexPart);\n                return;\n            }\n        }\n        replacePart = replacePart || vimGlobalState.lastSubstituteReplacePart;\n        if (replacePart === undefined) {\n            showConfirm(cm, 'No previous substitute regular expression');\n            return;\n        }\n        var state = getSearchState(cm);\n        var query = state.getQuery();\n        var lineStart = (params.line !== undefined) ? params.line : cm.getCursor().line;\n        var lineEnd = params.lineEnd || lineStart;\n        if (lineStart == cm.firstLine() && lineEnd == cm.lastLine()) {\n            lineEnd = Infinity;\n        }\n        if (count) {\n            lineStart = lineEnd;\n            lineEnd = lineStart + count - 1;\n        }\n        var startPos = clipCursorToContent(cm, new Pos(lineStart, 0));\n        var cursor = cm.getSearchCursor(query, startPos);\n        doReplace(cm, confirm, global, lineStart, lineEnd, cursor, query, replacePart, params.callback);\n    },\n    startinsert: function (cm, params) {\n        doKeyToKey(cm, params.argString == '!' ? 'A' : 'i', {});\n    },\n    redo: CodeMirror.commands.redo,\n    undo: CodeMirror.commands.undo,\n    write: function (cm) {\n        if (CodeMirror.commands.save) {\n            CodeMirror.commands.save(cm);\n        }\n        else if (cm.save) {\n            cm.save();\n        }\n    },\n    nohlsearch: function (cm) {\n        clearSearchHighlight(cm);\n    },\n    yank: function (cm) {\n        var cur = copyCursor(cm.getCursor());\n        var line = cur.line;\n        var lineText = cm.getLine(line);\n        vimGlobalState.registerController.pushText('0', 'yank', lineText, true, true);\n    },\n    delete: function (cm, params) {\n        var line = params.selectionLine;\n        var lineEnd = isNaN(params.selectionLineEnd) ? line : params.selectionLineEnd;\n        operators.delete(cm, { linewise: true }, [\n            { anchor: new Pos(line, 0),\n                head: new Pos(lineEnd + 1, 0) }\n        ]);\n    },\n    join: function (cm, params) {\n        var line = params.selectionLine;\n        var lineEnd = isNaN(params.selectionLineEnd) ? line : params.selectionLineEnd;\n        cm.setCursor(new Pos(line, 0));\n        actions.joinLines(cm, { repeat: lineEnd - line }, cm.state.vim);\n    },\n    delmarks: function (cm, params) {\n        if (!params.argString || !trim(params.argString)) {\n            showConfirm(cm, 'Argument required');\n            return;\n        }\n        var state = cm.state.vim;\n        var stream = new CodeMirror.StringStream(trim(params.argString));\n        while (!stream.eol()) {\n            stream.eatSpace();\n            var count = stream.pos;\n            if (!stream.match(/[a-zA-Z]/, false)) {\n                showConfirm(cm, 'Invalid argument: ' + params.argString.substring(count));\n                return;\n            }\n            var sym = stream.next();\n            if (stream.match('-', true)) {\n                if (!stream.match(/[a-zA-Z]/, false)) {\n                    showConfirm(cm, 'Invalid argument: ' + params.argString.substring(count));\n                    return;\n                }\n                var startMark = sym;\n                var finishMark = stream.next();\n                if (isLowerCase(startMark) && isLowerCase(finishMark) ||\n                    isUpperCase(startMark) && isUpperCase(finishMark)) {\n                    var start = startMark.charCodeAt(0);\n                    var finish = finishMark.charCodeAt(0);\n                    if (start >= finish) {\n                        showConfirm(cm, 'Invalid argument: ' + params.argString.substring(count));\n                        return;\n                    }\n                    for (var j = 0; j <= finish - start; j++) {\n                        var mark = String.fromCharCode(start + j);\n                        delete state.marks[mark];\n                    }\n                }\n                else {\n                    showConfirm(cm, 'Invalid argument: ' + startMark + '-');\n                    return;\n                }\n            }\n            else {\n                delete state.marks[sym];\n            }\n        }\n    }\n};\nvar exCommandDispatcher = new ExCommandDispatcher();\nfunction doReplace(cm, confirm, global, lineStart, lineEnd, searchCursor, query, replaceWith, callback) {\n    cm.state.vim.exMode = true;\n    var done = false;\n    var lastPos, modifiedLineNumber, joined;\n    function replaceAll() {\n        cm.operation(function () {\n            while (!done) {\n                replace();\n                next();\n            }\n            stop();\n        });\n    }\n    function replace() {\n        var text = cm.getRange(searchCursor.from(), searchCursor.to());\n        var newText = text.replace(query, replaceWith);\n        var unmodifiedLineNumber = searchCursor.to().line;\n        searchCursor.replace(newText);\n        modifiedLineNumber = searchCursor.to().line;\n        lineEnd += modifiedLineNumber - unmodifiedLineNumber;\n        joined = modifiedLineNumber < unmodifiedLineNumber;\n    }\n    function findNextValidMatch() {\n        var lastMatchTo = lastPos && copyCursor(searchCursor.to());\n        var match = searchCursor.findNext();\n        if (match && !match[0] && lastMatchTo && cursorEqual(searchCursor.from(), lastMatchTo)) {\n            match = searchCursor.findNext();\n        }\n        return match;\n    }\n    function next() {\n        while (findNextValidMatch() &&\n            isInRange(searchCursor.from(), lineStart, lineEnd)) {\n            if (!global && searchCursor.from().line == modifiedLineNumber && !joined) {\n                continue;\n            }\n            cm.scrollIntoView(searchCursor.from(), 30);\n            cm.setSelection(searchCursor.from(), searchCursor.to());\n            lastPos = searchCursor.from();\n            done = false;\n            return;\n        }\n        done = true;\n    }\n    function stop(close) {\n        if (close) {\n            close();\n        }\n        cm.focus();\n        if (lastPos) {\n            cm.setCursor(lastPos);\n            var vim = cm.state.vim;\n            vim.exMode = false;\n            vim.lastHPos = vim.lastHSPos = lastPos.ch;\n        }\n        if (callback) {\n            callback();\n        }\n    }\n    function onPromptKeyDown(e, _value, close) {\n        CodeMirror.e_stop(e);\n        var keyName = vimKeyFromEvent(e);\n        switch (keyName) {\n            case 'y':\n                replace();\n                next();\n                break;\n            case 'n':\n                next();\n                break;\n            case 'a':\n                var savedCallback = callback;\n                callback = undefined;\n                cm.operation(replaceAll);\n                callback = savedCallback;\n                break;\n            case 'l':\n                replace();\n            case 'q':\n            case '':\n            case '':\n            case '':\n                stop(close);\n                break;\n        }\n        if (done) {\n            stop(close);\n        }\n        return true;\n    }\n    next();\n    if (done) {\n        showConfirm(cm, 'No matches for ' + query.source);\n        return;\n    }\n    if (!confirm) {\n        replaceAll();\n        if (callback) {\n            callback();\n        }\n        return;\n    }\n    showPrompt(cm, {\n        prefix: dom('span', 'replace with ', dom('strong', replaceWith), ' (y/n/a/q/l)'),\n        onKeyDown: onPromptKeyDown\n    });\n}\nfunction exitInsertMode(cm, keepCursor) {\n    var vim = cm.state.vim;\n    var macroModeState = vimGlobalState.macroModeState;\n    var insertModeChangeRegister = vimGlobalState.registerController.getRegister('.');\n    var isPlaying = macroModeState.isPlaying;\n    var lastChange = macroModeState.lastInsertModeChanges;\n    if (!isPlaying) {\n        cm.off('change', onChange);\n        if (vim.insertEnd)\n            vim.insertEnd.clear();\n        vim.insertEnd = null;\n        CodeMirror.off(cm.getInputField(), 'keydown', onKeyEventTargetKeyDown);\n    }\n    if (!isPlaying && vim.insertModeRepeat > 1) {\n        repeatLastEdit(cm, vim, vim.insertModeRepeat - 1, true /** repeatForInsert */);\n        vim.lastEditInputState.repeatOverride = vim.insertModeRepeat;\n    }\n    delete vim.insertModeRepeat;\n    vim.insertMode = false;\n    if (!keepCursor) {\n        cm.setCursor(cm.getCursor().line, cm.getCursor().ch - 1);\n    }\n    cm.setOption('keyMap', 'vim');\n    cm.setOption('disableInput', true);\n    cm.toggleOverwrite(false); // exit replace mode if we were in it.\n    insertModeChangeRegister.setText(lastChange.changes.join(''));\n    CodeMirror.signal(cm, \"vim-mode-change\", { mode: \"normal\" });\n    if (macroModeState.isRecording) {\n        logInsertModeChange(macroModeState);\n    }\n}\nfunction _mapCommand(command) {\n    defaultKeymap.unshift(command);\n}\nfunction mapCommand(keys, type, name, args, extra) {\n    var command = { keys: keys, type: type };\n    command[type] = name;\n    command[type + \"Args\"] = args;\n    for (var key in extra)\n        command[key] = extra[key];\n    _mapCommand(command);\n}\ndefineOption('insertModeEscKeysTimeout', 200, 'number');\nfunction executeMacroRegister(cm, vim, macroModeState, registerName) {\n    var register = vimGlobalState.registerController.getRegister(registerName);\n    if (registerName == ':') {\n        if (register.keyBuffer[0]) {\n            exCommandDispatcher.processCommand(cm, register.keyBuffer[0]);\n        }\n        macroModeState.isPlaying = false;\n        return;\n    }\n    var keyBuffer = register.keyBuffer;\n    var imc = 0;\n    macroModeState.isPlaying = true;\n    macroModeState.replaySearchQueries = register.searchQueries.slice(0);\n    for (var i = 0; i < keyBuffer.length; i++) {\n        var text = keyBuffer[i];\n        var match, key;\n        while (text) {\n            match = (/<\\w+-.+?>|<\\w+>|./).exec(text);\n            key = match[0];\n            text = text.substring(match.index + key.length);\n            vimApi.handleKey(cm, key, 'macro');\n            if (vim.insertMode) {\n                var changes = register.insertModeChanges[imc++].changes;\n                vimGlobalState.macroModeState.lastInsertModeChanges.changes =\n                    changes;\n                repeatInsertModeChanges(cm, changes, 1);\n                exitInsertMode(cm);\n            }\n        }\n    }\n    macroModeState.isPlaying = false;\n}\nfunction logKey(macroModeState, key) {\n    if (macroModeState.isPlaying) {\n        return;\n    }\n    var registerName = macroModeState.latestRegister;\n    var register = vimGlobalState.registerController.getRegister(registerName);\n    if (register) {\n        register.pushText(key);\n    }\n}\nfunction logInsertModeChange(macroModeState) {\n    if (macroModeState.isPlaying) {\n        return;\n    }\n    var registerName = macroModeState.latestRegister;\n    var register = vimGlobalState.registerController.getRegister(registerName);\n    if (register && register.pushInsertModeChanges) {\n        register.pushInsertModeChanges(macroModeState.lastInsertModeChanges);\n    }\n}\nfunction logSearchQuery(macroModeState, query) {\n    if (macroModeState.isPlaying) {\n        return;\n    }\n    var registerName = macroModeState.latestRegister;\n    var register = vimGlobalState.registerController.getRegister(registerName);\n    if (register && register.pushSearchQuery) {\n        register.pushSearchQuery(query);\n    }\n}\nfunction onChange(cm, changeObj) {\n    var macroModeState = vimGlobalState.macroModeState;\n    var lastChange = macroModeState.lastInsertModeChanges;\n    if (!macroModeState.isPlaying) {\n        var vim = cm.state.vim;\n        while (changeObj) {\n            lastChange.expectCursorActivityForChange = true;\n            if (lastChange.ignoreCount > 1) {\n                lastChange.ignoreCount--;\n            }\n            else if (changeObj.origin == '+input' || changeObj.origin == 'paste'\n                || changeObj.origin === undefined /* only in testing */) {\n                var selectionCount = cm.listSelections().length;\n                if (selectionCount > 1)\n                    lastChange.ignoreCount = selectionCount;\n                var text = changeObj.text.join('\\n');\n                if (lastChange.maybeReset) {\n                    lastChange.changes = [];\n                    lastChange.maybeReset = false;\n                }\n                if (text) {\n                    if (cm.state.overwrite && !/\\n/.test(text)) {\n                        lastChange.changes.push([text]);\n                    }\n                    else {\n                        if (text.length > 1) {\n                            var insertEnd = vim && vim.insertEnd && vim.insertEnd.find();\n                            var cursor = cm.getCursor();\n                            if (insertEnd && insertEnd.line == cursor.line) {\n                                var offset = insertEnd.ch - cursor.ch;\n                                if (offset > 0 && offset < text.length) {\n                                    lastChange.changes.push([text, offset]);\n                                    text = '';\n                                }\n                            }\n                        }\n                        if (text)\n                            lastChange.changes.push(text);\n                    }\n                }\n            }\n            changeObj = changeObj.next;\n        }\n    }\n}\nfunction onCursorActivity(cm) {\n    var vim = cm.state.vim;\n    if (vim.insertMode) {\n        var macroModeState = vimGlobalState.macroModeState;\n        if (macroModeState.isPlaying) {\n            return;\n        }\n        var lastChange = macroModeState.lastInsertModeChanges;\n        if (lastChange.expectCursorActivityForChange) {\n            lastChange.expectCursorActivityForChange = false;\n        }\n        else {\n            lastChange.maybeReset = true;\n            if (vim.insertEnd)\n                vim.insertEnd.clear();\n            vim.insertEnd = cm.setBookmark(cm.getCursor(), { insertLeft: true });\n        }\n    }\n    else if (!cm.curOp.isVimOp) {\n        handleExternalSelection(cm, vim);\n    }\n}\nfunction handleExternalSelection(cm, vim, keepHPos) {\n    var anchor = cm.getCursor('anchor');\n    var head = cm.getCursor('head');\n    if (vim.visualMode && !cm.somethingSelected()) {\n        exitVisualMode(cm, false);\n    }\n    else if (!vim.visualMode && !vim.insertMode && cm.somethingSelected()) {\n        vim.visualMode = true;\n        vim.visualLine = false;\n        CodeMirror.signal(cm, \"vim-mode-change\", { mode: \"visual\" });\n    }\n    if (vim.visualMode) {\n        var headOffset = !cursorIsBefore(head, anchor) ? -1 : 0;\n        var anchorOffset = cursorIsBefore(head, anchor) ? -1 : 0;\n        head = offsetCursor(head, 0, headOffset);\n        anchor = offsetCursor(anchor, 0, anchorOffset);\n        vim.sel = {\n            anchor: anchor,\n            head: head\n        };\n        updateMark(cm, vim, '<', cursorMin(head, anchor));\n        updateMark(cm, vim, '>', cursorMax(head, anchor));\n    }\n    else if (!vim.insertMode && !keepHPos) {\n        vim.lastHPos = cm.getCursor().ch;\n    }\n}\nfunction InsertModeKey(keyName, e) {\n    this.keyName = keyName;\n    this.key = e.key;\n    this.ctrlKey = e.ctrlKey;\n    this.altKey = e.altKey;\n    this.metaKey = e.metaKey;\n    this.shiftKey = e.shiftKey;\n}\nfunction onKeyEventTargetKeyDown(e) {\n    var macroModeState = vimGlobalState.macroModeState;\n    var lastChange = macroModeState.lastInsertModeChanges;\n    var keyName = CodeMirror.keyName ? CodeMirror.keyName(e) : e.key;\n    if (!keyName) {\n        return;\n    }\n    if (keyName.indexOf('Delete') != -1 || keyName.indexOf('Backspace') != -1) {\n        if (lastChange.maybeReset) {\n            lastChange.changes = [];\n            lastChange.maybeReset = false;\n        }\n        lastChange.changes.push(new InsertModeKey(keyName, e));\n    }\n}\nfunction repeatLastEdit(cm, vim, repeat, repeatForInsert) {\n    var macroModeState = vimGlobalState.macroModeState;\n    macroModeState.isPlaying = true;\n    var isAction = !!vim.lastEditActionCommand;\n    var cachedInputState = vim.inputState;\n    function repeatCommand() {\n        if (isAction) {\n            commandDispatcher.processAction(cm, vim, vim.lastEditActionCommand);\n        }\n        else {\n            commandDispatcher.evalInput(cm, vim);\n        }\n    }\n    function repeatInsert(repeat) {\n        if (macroModeState.lastInsertModeChanges.changes.length > 0) {\n            repeat = !vim.lastEditActionCommand ? 1 : repeat;\n            var changeObject = macroModeState.lastInsertModeChanges;\n            repeatInsertModeChanges(cm, changeObject.changes, repeat);\n        }\n    }\n    vim.inputState = vim.lastEditInputState;\n    if (isAction && vim.lastEditActionCommand.interlaceInsertRepeat) {\n        for (var i = 0; i < repeat; i++) {\n            repeatCommand();\n            repeatInsert(1);\n        }\n    }\n    else {\n        if (!repeatForInsert) {\n            repeatCommand();\n        }\n        repeatInsert(repeat);\n    }\n    vim.inputState = cachedInputState;\n    if (vim.insertMode && !repeatForInsert) {\n        exitInsertMode(cm);\n    }\n    macroModeState.isPlaying = false;\n}\nfunction sendCmKey(cm, key) {\n    CodeMirror.lookupKey(key, 'vim-insert', function keyHandler(binding) {\n        if (typeof binding == 'string') {\n            CodeMirror.commands[binding](cm);\n        }\n        else {\n            binding(cm);\n        }\n        return true;\n    });\n}\nfunction repeatInsertModeChanges(cm, changes, repeat) {\n    var head = cm.getCursor('head');\n    var visualBlock = vimGlobalState.macroModeState.lastInsertModeChanges.visualBlock;\n    if (visualBlock) {\n        selectForInsert(cm, head, visualBlock + 1);\n        repeat = cm.listSelections().length;\n        cm.setCursor(head);\n    }\n    for (var i = 0; i < repeat; i++) {\n        if (visualBlock) {\n            cm.setCursor(offsetCursor(head, i, 0));\n        }\n        for (var j = 0; j < changes.length; j++) {\n            var change = changes[j];\n            if (change instanceof InsertModeKey) {\n                sendCmKey(cm, change.keyName, change);\n            }\n            else if (typeof change == \"string\") {\n                cm.replaceSelection(change);\n            }\n            else {\n                var start = cm.getCursor();\n                var end = offsetCursor(start, 0, change[0].length - (change[1] || 0));\n                cm.replaceRange(change[0], start, change[1] ? start : end);\n                cm.setCursor(end);\n            }\n        }\n    }\n    if (visualBlock) {\n        cm.setCursor(offsetCursor(head, 0, 1));\n    }\n}\nCodeMirror.Vim = vimApi;\nvar specialKeyAce = { 'return': 'CR', backspace: 'BS', 'delete': 'Del', esc: 'Esc',\n    left: 'Left', right: 'Right', up: 'Up', down: 'Down', space: 'Space', insert: 'Ins',\n    home: 'Home', end: 'End', pageup: 'PageUp', pagedown: 'PageDown', enter: 'CR'\n};\nfunction lookupKey(hashId, key, e, vim) {\n    if (key.length > 1 && key[0] == \"n\") {\n        key = key.replace(\"numpad\", \"\");\n    }\n    key = specialKeyAce[key] || key;\n    var name = '';\n    if (e.ctrlKey) {\n        name += 'C-';\n    }\n    if (e.altKey) {\n        name += 'A-';\n    }\n    if ((name || key.length > 1) && e.shiftKey) {\n        name += 'S-';\n    }\n    if (vim && !vim.expectLiteralNext && key.length == 1) {\n        if (langmap.keymap && key in langmap.keymap) {\n            if (langmap.remapCtrl !== false || !name)\n                key = langmap.keymap[key];\n        }\n        else if (key.charCodeAt(0) > 255) {\n            var code = e.code && e.code.slice(-1) || \"\";\n            if (!e.shiftKey)\n                code = code.toLowerCase();\n            if (code)\n                key = code;\n        }\n    }\n    name += key;\n    if (name.length > 1) {\n        name = '<' + name + '>';\n    }\n    return name;\n}\nvar handleKey = vimApi.handleKey.bind(vimApi);\nvimApi.handleKey = function (cm, key, origin) {\n    return cm.operation(function () {\n        return handleKey(cm, key, origin);\n    }, true);\n};\nfunction cloneVimState(state) {\n    var n = new state.constructor();\n    Object.keys(state).forEach(function (key) {\n        if (key == \"insertEnd\")\n            return;\n        var o = state[key];\n        if (Array.isArray(o))\n            o = o.slice();\n        else if (o && typeof o == \"object\" && o.constructor != Object)\n            o = cloneVimState(o);\n        n[key] = o;\n    });\n    if (state.sel) {\n        n.sel = {\n            head: state.sel.head && copyCursor(state.sel.head),\n            anchor: state.sel.anchor && copyCursor(state.sel.anchor)\n        };\n    }\n    return n;\n}\nfunction multiSelectHandleKey(cm, key, origin) {\n    var isHandled = false;\n    var vim = vimApi.maybeInitVimState_(cm);\n    var visualBlock = vim.visualBlock || vim.wasInVisualBlock;\n    var wasMultiselect = cm.ace.inMultiSelectMode;\n    if (vim.wasInVisualBlock && !wasMultiselect) {\n        vim.wasInVisualBlock = false;\n    }\n    else if (wasMultiselect && vim.visualBlock) {\n        vim.wasInVisualBlock = true;\n    }\n    if (key == '' && !vim.insertMode && !vim.visualMode && wasMultiselect) {\n        cm.ace.exitMultiSelectMode();\n    }\n    else if (visualBlock || !wasMultiselect || cm.ace.inVirtualSelectionMode) {\n        isHandled = vimApi.handleKey(cm, key, origin);\n    }\n    else {\n        var old = cloneVimState(vim);\n        var changeQueueList = vim.inputState.changeQueueList || [];\n        cm.operation(function () {\n            cm.curOp.isVimOp = true;\n            var index = 0;\n            cm.ace.forEachSelection(function () {\n                var sel = cm.ace.selection;\n                cm.state.vim.lastHPos = sel.$desiredColumn == null ? sel.lead.column : sel.$desiredColumn;\n                cm.state.vim.inputState.changeQueue = changeQueueList[index];\n                var head = cm.getCursor(\"head\");\n                var anchor = cm.getCursor(\"anchor\");\n                var headOffset = !cursorIsBefore(head, anchor) ? -1 : 0;\n                var anchorOffset = cursorIsBefore(head, anchor) ? -1 : 0;\n                head = offsetCursor(head, 0, headOffset);\n                anchor = offsetCursor(anchor, 0, anchorOffset);\n                cm.state.vim.sel.head = head;\n                cm.state.vim.sel.anchor = anchor;\n                isHandled = handleKey(cm, key, origin);\n                sel.$desiredColumn = cm.state.vim.lastHPos == -1 ? null : cm.state.vim.lastHPos;\n                if (cm.ace.inVirtualSelectionMode) {\n                    changeQueueList[index] = cm.state.vim.inputState.changeQueue;\n                }\n                if (cm.virtualSelectionMode()) {\n                    cm.state.vim = cloneVimState(old);\n                }\n                index++;\n            });\n            if (cm.curOp.cursorActivity && !isHandled)\n                cm.curOp.cursorActivity = false;\n            vim.status = cm.state.vim.status;\n            cm.state.vim = vim;\n            vim.inputState.changeQueueList = changeQueueList;\n            vim.inputState.changeQueue = null;\n        }, true);\n    }\n    if (isHandled && !vim.visualMode && !vim.insert && vim.visualMode != cm.somethingSelected()) {\n        handleExternalSelection(cm, vim, true);\n    }\n    return isHandled;\n}\nresetVimGlobalState();\nexports.CodeMirror = CodeMirror;\nvar getVim = vimApi.maybeInitVimState_;\nexports.handler = {\n    $id: \"ace/keyboard/vim\",\n    drawCursor: function (element, pixelPos, config, sel, session) {\n        var vim = this.state.vim || {};\n        var w = config.characterWidth;\n        var h = config.lineHeight;\n        var top = pixelPos.top;\n        var left = pixelPos.left;\n        if (!vim.insertMode) {\n            var isbackwards = !sel.cursor\n                ? session.selection.isBackwards() || session.selection.isEmpty()\n                : Range.comparePoints(sel.cursor, sel.start) <= 0;\n            if (!isbackwards && left > w)\n                left -= w;\n        }\n        if (!vim.insertMode && vim.status) {\n            h = h / 2;\n            top += h;\n        }\n        domLib.translate(element, left, top);\n        domLib.setStyle(element.style, \"width\", w + \"px\");\n        domLib.setStyle(element.style, \"height\", h + \"px\");\n    },\n    $getDirectionForHighlight: function (editor) {\n        var cm = editor.state.cm;\n        var vim = getVim(cm);\n        if (!vim.insertMode) {\n            return editor.session.selection.isBackwards() || editor.session.selection.isEmpty();\n        }\n    },\n    handleKeyboard: function (data, hashId, key, keyCode, e) {\n        var editor = data.editor;\n        var cm = editor.state.cm;\n        var vim = getVim(cm);\n        if (keyCode == -1)\n            return;\n        if (!vim.insertMode) {\n            if (hashId == -1) {\n                if (key.charCodeAt(0) > 0xFF) {\n                    if (data.inputKey) {\n                        key = data.inputKey;\n                        if (key && data.inputHash == 4)\n                            key = key.toUpperCase();\n                    }\n                }\n                data.inputChar = key;\n            }\n            else if (hashId == 4 || hashId == 0) {\n                if (data.inputKey == key && data.inputHash == hashId && data.inputChar) {\n                    key = data.inputChar;\n                    hashId = -1;\n                }\n                else {\n                    data.inputChar = null;\n                    data.inputKey = key;\n                    data.inputHash = hashId;\n                }\n            }\n            else {\n                data.inputChar = data.inputKey = null;\n            }\n        }\n        if (cm.state.overwrite && vim.insertMode && key == \"backspace\" && hashId == 0) {\n            return { command: \"gotoleft\" };\n        }\n        if (key == \"c\" && hashId == 1) { // key == \"ctrl-c\"\n            if (!useragent.isMac && editor.getCopyText()) {\n                editor.once(\"copy\", function () {\n                    if (vim.insertMode)\n                        editor.selection.clearSelection();\n                    else\n                        cm.operation(function () { exitVisualMode(cm); });\n                });\n                return { command: \"null\", passEvent: true };\n            }\n        }\n        if (key == \"esc\" && !vim.insertMode && !vim.visualMode && !cm.ace.inMultiSelectMode) {\n            var searchState = getSearchState(cm);\n            var overlay = searchState.getOverlay();\n            if (overlay)\n                cm.removeOverlay(overlay);\n        }\n        if (hashId == -1 || hashId & 1 || hashId === 0 && key.length > 1) {\n            var insertMode = vim.insertMode;\n            var name = lookupKey(hashId, key, e || {}, vim);\n            if (vim.status == null)\n                vim.status = \"\";\n            var isHandled = multiSelectHandleKey(cm, name, 'user');\n            vim = getVim(cm); // may be changed by multiSelectHandleKey\n            if (isHandled && vim.status != null)\n                vim.status += name;\n            else if (vim.status == null)\n                vim.status = \"\";\n            cm._signal(\"changeStatus\");\n            if (!isHandled && (hashId != -1 || insertMode))\n                return;\n            return { command: \"null\", passEvent: !isHandled };\n        }\n    },\n    attach: function (editor) {\n        if (!editor.state)\n            editor.state = {};\n        var cm = new CodeMirror(editor);\n        editor.state.cm = cm;\n        editor.$vimModeHandler = this;\n        enterVimMode(cm);\n        getVim(cm).status = null;\n        cm.on('vim-command-done', function () {\n            if (cm.virtualSelectionMode())\n                return;\n            getVim(cm).status = null;\n            cm.ace._signal(\"changeStatus\");\n            cm.ace.session.markUndoGroup();\n        });\n        cm.on(\"changeStatus\", function () {\n            cm.ace.renderer.updateCursor();\n            cm.ace._signal(\"changeStatus\");\n        });\n        cm.on(\"vim-mode-change\", function () {\n            if (cm.virtualSelectionMode())\n                return;\n            updateInputMode();\n            cm._signal(\"changeStatus\");\n        });\n        function updateInputMode() {\n            var isIntsert = getVim(cm).insertMode;\n            cm.ace.renderer.setStyle(\"normal-mode\", !isIntsert);\n            editor.textInput.setCommandMode(!isIntsert);\n            editor.renderer.$keepTextAreaAtCursor = isIntsert;\n            editor.renderer.$blockCursor = !isIntsert;\n        }\n        updateInputMode();\n        editor.renderer.$cursorLayer.drawCursor = this.drawCursor.bind(cm);\n    },\n    detach: function (editor) {\n        var cm = editor.state.cm;\n        leaveVimMode(cm);\n        cm.destroy();\n        editor.state.cm = null;\n        editor.$vimModeHandler = null;\n        editor.renderer.$cursorLayer.drawCursor = null;\n        editor.renderer.setStyle(\"normal-mode\", false);\n        editor.textInput.setCommandMode(false);\n        editor.renderer.$keepTextAreaAtCursor = true;\n    },\n    getStatusText: function (editor) {\n        var cm = editor.state.cm;\n        var vim = getVim(cm);\n        if (vim.insertMode)\n            return \"INSERT\";\n        var status = \"\";\n        if (vim.visualMode) {\n            status += \"VISUAL\";\n            if (vim.visualLine)\n                status += \" LINE\";\n            if (vim.visualBlock)\n                status += \" BLOCK\";\n        }\n        if (vim.status)\n            status += (status ? \" \" : \"\") + vim.status;\n        return status;\n    }\n};\nvimApi.defineOption({\n    name: \"wrap\",\n    set: function (value, cm) {\n        if (cm) {\n            cm.ace.setOption(\"wrap\", value);\n        }\n    },\n    type: \"boolean\"\n}, false);\nvimApi.defineEx('write', 'w', function () {\n    console.log(':write is not implemented');\n});\ndefaultKeymap.push({ keys: 'zc', type: 'action', action: 'fold', actionArgs: { open: false } }, { keys: 'zC', type: 'action', action: 'fold', actionArgs: { open: false, all: true } }, { keys: 'zo', type: 'action', action: 'fold', actionArgs: { open: true } }, { keys: 'zO', type: 'action', action: 'fold', actionArgs: { open: true, all: true } }, { keys: 'za', type: 'action', action: 'fold', actionArgs: { toggle: true } }, { keys: 'zA', type: 'action', action: 'fold', actionArgs: { toggle: true, all: true } }, { keys: 'zf', type: 'action', action: 'fold', actionArgs: { open: true, all: true } }, { keys: 'zd', type: 'action', action: 'fold', actionArgs: { open: true, all: true } }, { keys: '', type: 'action', action: 'aceCommand', actionArgs: { name: \"addCursorAbove\" } }, { keys: '', type: 'action', action: 'aceCommand', actionArgs: { name: \"addCursorBelow\" } }, { keys: '', type: 'action', action: 'aceCommand', actionArgs: { name: \"addCursorAboveSkipCurrent\" } }, { keys: '', type: 'action', action: 'aceCommand', actionArgs: { name: \"addCursorBelowSkipCurrent\" } }, { keys: '', type: 'action', action: 'aceCommand', actionArgs: { name: \"selectMoreBefore\" } }, { keys: '', type: 'action', action: 'aceCommand', actionArgs: { name: \"selectMoreAfter\" } }, { keys: '', type: 'action', action: 'aceCommand', actionArgs: { name: \"selectNextBefore\" } }, { keys: '', type: 'action', action: 'aceCommand', actionArgs: { name: \"selectNextAfter\" } });\ndefaultKeymap.push({\n    keys: 'gq',\n    type: 'operator',\n    operator: 'hardWrap'\n});\nvimApi.defineOperator(\"hardWrap\", function (cm, operatorArgs, ranges, oldAnchor, newHead) {\n    var anchor = ranges[0].anchor.line;\n    var head = ranges[0].head.line;\n    if (operatorArgs.linewise)\n        head--;\n    hardWrap(cm.ace, { startRow: anchor, endRow: head });\n    return Pos(head, 0);\n});\ndefineOption('textwidth', undefined, 'number', ['tw'], function (width, cm) {\n    if (cm === undefined) {\n        return;\n    }\n    if (width === undefined) {\n        var value = cm.ace.getOption('printMarginColumn');\n        return value;\n    }\n    else {\n        var column = Math.round(width);\n        if (column > 1) {\n            cm.ace.setOption('printMarginColumn', column);\n        }\n    }\n});\nactions.aceCommand = function (cm, actionArgs, vim) {\n    cm.vimCmd = actionArgs;\n    if (cm.ace.inVirtualSelectionMode)\n        cm.ace.on(\"beforeEndOperation\", delayedExecAceCommand);\n    else\n        delayedExecAceCommand(null, cm.ace);\n};\nfunction delayedExecAceCommand(op, ace) {\n    ace.off(\"beforeEndOperation\", delayedExecAceCommand);\n    var cmd = ace.state.cm.vimCmd;\n    if (cmd) {\n        ace.execCommand(cmd.exec ? cmd : cmd.name, cmd.args);\n    }\n    ace.curOp = ace.prevOp;\n}\nactions.fold = function (cm, actionArgs, vim) {\n    cm.ace.execCommand(['toggleFoldWidget', 'toggleFoldWidget', 'foldOther', 'unfoldall'\n    ][(actionArgs.all ? 2 : 0) + (actionArgs.open ? 1 : 0)]);\n};\ndefaultKeymapLength = defaultKeymap.length; // ace_patch\nexports.handler.defaultKeymap = defaultKeymap;\nexports.handler.actions = actions;\nexports.Vim = vimApi;\n\n});                (function() {\n                    ace.require([\"ace/keyboard/vim\"], function(m) {\n                        if (typeof module == \"object\" && typeof exports == \"object\" && module) {\n                            module.exports = m;\n                        }\n                    });\n                })();\n            "],"mappings":"qEAAA,IAAAA,GAAAC,GAAA,CAAAC,GAAAC,KAAA,KAAI,OAAO,mBAAmB,CAAC,UAAU,UAAU,SAAS,YAAY,aAAa,YAAY,EAAG,SAASC,EAASF,EAASC,GAAO,CAAC,aACvI,IAAIE,GAAQD,EAAQ,UAAU,EAAE,MAChC,SAASE,EAASC,GAAQC,EAAS,CAM/B,QALIC,EAAMD,EAAQ,QAAUD,GAAO,UAAU,mBAAmB,EAC5DG,GAAaF,EAAQ,YAAc,GACnCG,EAAM,KAAK,IAAIH,EAAQ,SAAUA,EAAQ,MAAM,EAC/CI,GAAS,KAAK,IAAIJ,EAAQ,SAAUA,EAAQ,MAAM,EAClDK,GAAUN,GAAO,QACdI,GAAOC,IAAQ,CAClB,IAAIE,GAAOD,GAAQ,QAAQF,CAAG,EAC9B,GAAIG,GAAK,OAASL,EAAK,CACnB,IAAIM,GAAQC,EAAUF,GAAML,EAAK,CAAC,EAClC,GAAIM,GAAO,CACP,IAAIE,EAAc,OAAO,KAAKH,EAAI,EAAE,CAAC,EACrCD,GAAQ,QAAQ,IAAIR,GAAMM,EAAKI,GAAM,MAAOJ,EAAKI,GAAM,GAAG,EAAG;AAAA,EAAOE,CAAW,CACnF,CACAL,IACJ,SACSF,IAAc,KAAK,KAAKI,EAAI,GAAKH,GAAOC,GAAQ,CACrD,IAAIM,EAAWL,GAAQ,QAAQF,EAAM,CAAC,EACtC,GAAIO,GAAY,KAAK,KAAKA,CAAQ,EAAG,CACjC,IAAIC,EAAcL,GAAK,QAAQ,OAAQ,EAAE,EACrCM,GAAkBF,EAAS,QAAQ,OAAQ,EAAE,EAC7CG,EAAaF,EAAc,IAAMC,GACjCL,GAAQC,EAAUK,EAAYZ,EAAK,CAAC,EACxC,GAAIM,IAASA,G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,MAAQA,EAAI,MACpB,CACAyI,GAAQ,KAAO,SAAUpI,EAAI0S,EAAYxK,EAAK,CAC1ClI,EAAG,IAAI,YAAY,CAAC,mBAAoB,mBAAoB,YAAa,WACzE,GAAG0S,EAAW,IAAM,EAAI,IAAMA,EAAW,KAAO,EAAI,EAAE,CAAC,CAC3D,EACAlL,GAAsBD,EAAc,OACpChL,EAAQ,QAAQ,cAAgBgL,EAChChL,EAAQ,QAAQ,QAAU6L,GAC1B7L,EAAQ,IAAM8P,CAEd,CAAC,GAAmB,UAAW,CACX,IAAI,QAAQ,CAAC,kBAAkB,EAAG,SAASnM,EAAG,CACtC,OAAO1D,IAAU,UAAY,OAAOD,IAAW,UAAYC,KAC3DA,GAAO,QAAU0D,EAEzB,CAAC,CACL,GAAG","names":["require_d09463c099fb2c44719380623a5c68fb","__commonJSMin","exports","module","require","Range","hardWrap","editor","options","max","allowMerge","row","endRow","session","line","space","findSpace","indentation","nextLine","trimmedLine","trimmedNextLine","mergedLine","replaceRange","min","before","after","spaceAfter","spaceBefore","start","end","wrapAfterInput","e","cursor","lastDelta","Editor","val","log","d","format","p","x","i","f","EventEmitter","domLib","oop","KEYS","event","Search","useragent","SearchHighlight","multiSelectCommands","TextModeTokenRe","CodeMirror","ace","ch","Pos","name","setter","cm","key","m","cmd","lookupKey","map","handle","found","result","head","o","delta","change","curOp","fn","force","prevOp","op","eventName","handlers","listeners","shouldScroll","sel","pos","toCmPos","ranges","r","primIndex","anchor","toAcePos","range","a","h","isInsert","rowShift","colShift","point","cmp","cmp2","Marker","id","column","bm","increment","unit","amount","goalColumn","renderer","config","screenPos","mode","sc","lh","cw","top","col","query","caseFold","caseSensitive","isRegexp","search","acePos","last","back","text","y","maxHeight","margin","viewMargin","s","strings","optMap","aceOpt","on","highlight","marker","re","v","token","method","index","dir","_","tokenRe","deltas","undoManager","cmPos","StringStream","string","tabSize","match","ok","n","pattern","consume","caseInsensitive","cased","str","substr","inner","dialogDiv","template","bottom","wrap","dialog","closeNotification","newVal","callback","closed","me","close","inp","button","doneTimer","duration","updateSelectionForSurrogateCharacters","curStart","curEnd","charCode","defaultKeymap","defaultKeymapLength","defaultExCommandMap","langmap","parseLangmap","enterVimMode","onCursorActivity","maybeInitVimState","getOnPasteFn","leaveVimMode","highlightTimeout","vim","offsetCursor","actions","numberRegex","wordCharTest","bigWordCharTest","validMarks","validRegisters","latinCharRegex","upperCaseChars","isLine","isLowerCase","k","isMatchableSymbol","isNumber","isUpperCase","isWhiteSpaceString","isEndOfSentenceSymbol","inArray","arr","defineOption","defaultValue","type","aliases","setOption","value","cfg","option","scope","getOption","local","width","createCircularJumpList","size","pointer","tail","buffer","add","oldCur","newCur","current","curMark","useNextSlot","next","trashMark","markPos","cursorEqual","move","offset","mark","inc","find","oldPointer","createInsertModeChanges","c","MacroModeState","macroModeState","vimGlobalState","registerName","register","dom","InputState","resetVimGlobalState","RegisterController","HistoryController","optionName","lastInsertModeKeyTimer","vimApi","InsertModeKey","lhs","rhs","ctx","exCommandDispatcher","actualLength","origLength","userKeymap","mapping","contexts","j","newMapping","updateLangmap","vimKeyFromEvent","prefix","func","exCommands","origin","command","multiSelectHandleKey","handleMacroRecording","clearInputState","logKey","handleEsc","exitVisualMode","exitInsertMode","handleKeyInsertMode","keys","keysAreChars","commandDispatcher","changeQueue","selections","ChangeQueue","from","cursorMin","to","cursorMax","here","handleKeyNonInsertMode","keysMatcher","context","mainKey","doKeyToKey","input","defineMotion","defineAction","defineOperator","mapCommand","_mapCommand","defineRegister","keyToKeyStack","noremap","virtualPrompt","sendKeyToPrompt","lowerKey","parts","vimToCmKeyMap","prompt","fromKey","noremapBefore","keyRe","wasInsert","sendCmKey","promptOptions","showPrompt","specialKey","ignoredKeys","code","langmapString","remapCtrl","keymap","getEscaped","list","part","semicolon","pairs","repeat","reason","Register","linewise","blockwise","changes","registers","operator","append","up","historyBuffer","element","keyMap","inputState","matches","commandMatches","bestMatch","character","lastChar","copyArgs","updateCmSelection","visualMode","operatorMotionArgs","repeatIsExplicit","actionArgs","forward","wholeWordOnly","getSearchState","promptPrefix","originalQuery","originalScrollPos","handleQuery","ignoreCase","smartCase","updateSearchQuery","showConfirm","onPromptClose","logSearchQuery","onPromptKeyUp","keyName","parsedQuery","findNext","clearSearchHighlight","onPromptKeyDown","word","expandWordUnderCursor","isKeyword","escapeRegex","motion","motionArgs","operatorArgs","origHead","copyCursor","clipCursorToContent","origAnchor","oldHead","oldAnchor","newHead","newAnchor","motionResult","motions","jumpList","cachedCursor","recordJumpPosition","updateMark","cursorIsBefore","lastSel","lineOffset","chOffset","cmSel","newPositions","makeCmSelection","lineLength","tmp","expandSelectionToLine","clipToLine","exclusive","operatorMoveTo","operators","actionCommand","_head","getUserVisibleLines","findFirstNonWhiteSpaceCharacter","_cm","cur","state","prev","highlightSearchMatches","prevInputState","findNextFromAndToInclusive","getMarkPos","best","isWrongDirection","equal","between","cursorIsBetween","endCh","first","moveToEol","fold","res","lastCharCoords","goalCoords","resCoords","findParagraph","findSentence","scrollbox","orig","dest","moveToWord","moveToCharacter","recordLastCharacterSearch","findSymbol","moveToColumn","lineText","symbol","style","matched","lineNum","mirroredPairs","selfPaired","inclusive","selectCompanionObject","findBeginningAndEnd","repeated","expandTagUnderCursor","content","getSentence","expandSelection","lastSearch","fillArray","times","args","finalHead","replacement","lastState","startLine","endLine","_args","swapped","toLower","toSwap","endPos","lineHeight","newPos","cursorCoords","newBottom","charCoords","height","lineLastCharPos","lineLastCharCoords","executeMacroRegister","insertAt","newPosition","getLastEditPos","onChange","onKeyEventTargetKeyDown","selectForInsert","_actionArgs","lastSelection","updateLastSelection","finalCh","nextStartCh","curFinalPos","newlineFn","_this","fallback","whitespaceLength","tabs","spaces","currentLine","indent","chompedText","wasChomped","firstIndent","wspace","newIndent","quotient","curPosFinal","lastSelectionCurEnd","selectedArea","getSelectedAreaRange","selectionStart","selectionEnd","selectedText","emptyStrings","selectBlock","lastCh","extendLineToColumn","repeatFn","handler","markName","replaceWith","replaceTo","replaceWithStr","lineStr","numberStr","baseStr","digits","base","number","zeroPadding","lastEditInputState","repeatLastEdit","includeLineBreak","maxCh","direction","ret","prop","offsetLine","offsetCh","partial","full","startIndex","commandMatch","pressed","mapped","isLastCharacter","isLastRegister","prefixLen","pressedPrefix","mappedPrefix","selectedCharacter","cur1","cur2","cur3","cur1before2","cur2before3","trim","isClipped","curHead","getIndex","wasClipped","firstLine","lastLine","baseCh","headCh","newDir","lineHead","atAnchor","atHead","getCurrentSelectedAreaRange","getLastSelectedAreaRange","block","headOffset","anchorOffset","fromCh","toCh","primary","getHead","moveHead","selection","lines","firstNonWS","_a","innerWord","bigWord","noSymbol","multiline","startLineNumber","endLineNumber","idx","wordOnNextLine","test","findWord","wordEnd","startsWithSpace","wordStart","tags","symbolToMode","findSymbolModes","symb","curCh","init","isComplete","lineLen","emptyLineIsWord","charTests","stop","foundWord","words","eodCh","shortCircuit","firstWord","lastWord","keepHPos","retval","charIdxInLine","includeChar","isEmpty","isBoundary","any","skipFold","foldLine","startState","nextChar","curr","ln","lastSentencePos","reverse","curr_index","last_valid","skip_empty_lines","bracketRegexp","openSym","curChar","chars","len","firstIndex","stringAfter","stringBefore","isStringStart","SearchState","overlay","reversed","annotate","splitBySlash","argString","splitBySeparator","findUnescapedSlashes","findUnescapedSeparators","separator","slashes","tokens","escapeNextChar","translateRegex","specials","unescape","out","specialComesNext","charUnescapes","translateRegexReplace","unescapes","unescapeRegexReplace","stream","output","matcher","parseQuery","lastSearchRegister","regexPart","forceIgnoreCase","flagsPart","regexp","pre","makePrompt","desc","shortText","regexEqual","r1","r2","props","rawQuery","searchOverlay","matchSol","searchState","lastEndPos","isInRange","done","ExCommandDispatcher","opt_params","that","commandHistoryRegister","previousCommand","inputStream","params","commandName","numberMatch","offsetMatch","delim","defaultOnly","mapArgs","setArgs","setCfg","expr","forceGet","forceToggle","optionIsBoolean","oldValue","setOptionReturn","regArgs","regInfo","unique","parseArgs","opts","decimal","hex","octal","err","lineStart","lineEnd","radix","numPart","textPart","matchPart","compareFn","b","anum","bnum","comparePatternFn","textOld","inverted","matchedLines","nextCommand","lineHandle","replacePart","trailing","count","confirm","global","startPos","doReplace","sym","startMark","finishMark","finish","searchCursor","lastPos","modifiedLineNumber","joined","replaceAll","replace","newText","unmodifiedLineNumber","findNextValidMatch","lastMatchTo","_value","savedCallback","keepCursor","insertModeChangeRegister","isPlaying","lastChange","logInsertModeChange","extra","keyBuffer","imc","repeatInsertModeChanges","changeObj","selectionCount","insertEnd","handleExternalSelection","repeatForInsert","isAction","cachedInputState","repeatCommand","repeatInsert","changeObject","binding","visualBlock","specialKeyAce","hashId","handleKey","cloneVimState","isHandled","wasMultiselect","old","changeQueueList","getVim","pixelPos","w","left","isbackwards","data","keyCode","insertMode","updateInputMode","isIntsert","status","delayedExecAceCommand"],"sourceRoot":"","file":"d09463c099fb2c44719380623a5c68fb.js"}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy