Merge branch 'master' into gq

Conflicts:
	package.json
This commit is contained in:
johnfn 2016-12-03 19:54:51 -05:00
commit c7ebb5536d
3 changed files with 384 additions and 372 deletions

View File

@ -18,7 +18,7 @@ Ask us questions, talk about contributing, or just say hi on [Slack](https://vsc
## Supported Options
The following is a subset of the supported configurations; the full list is described in [package.json](https://github.com/VSCodeVim/Vim/blob/master/package.json#L175):
The following is a subset of the supported configurations; the full list is described in the `Contributions` tab for this extension, or in our [package.json](https://github.com/VSCodeVim/Vim/blob/master/package.json#L175):
#### insertModeKeyBindings/otherModesKeyBindings
* Keybinding overrides to use for insert and other (non-insert) modes
@ -58,6 +58,7 @@ The following is a subset of the supported configurations; the full list is desc
#### startInInsertMode
* Have VSCodeVim start in Insert Mode rather than Normal Mode.
* We would be remiss in our duties as Vim users not to say that you should really be staying in Normal mode as much as you can, but hey, who are we to stop you?
#### useCtrlKeys
* Enable Vim ctrl keys overriding common VS Code operations (eg. copy, paste, find, etc). Setting this option to true will enable:

View File

@ -1,370 +1,370 @@
{
"name": "vim",
"displayName": "Vim",
"description": "Vim emulation for Visual Studio Code",
"icon": "images/icon.png",
"version": "0.4.4",
"publisher": "vscodevim",
"galleryBanner": {
"color": "#e3f4ff",
"theme": "light"
},
"license": "MIT",
"keywords": [
"vim",
"vi",
"vscodevim"
],
"repository": {
"type": "git",
"url": "https://github.com/VSCodeVim/Vim.git"
},
"homepage": "https://github.com/VSCodeVim/Vim",
"bugs": {
"url": "https://github.com/VSCodeVim/Vim/issues"
},
"engines": {
"vscode": "^1.6.0"
},
"categories": [
"Other",
"Keymaps"
],
"activationEvents": [
"*"
],
"main": "./out/extension",
"contributes": {
"commands": [
{
"command": "extension.showCmdLine",
"title": "Vim: Show Command Line"
}
"name": "vim",
"displayName": "Vim",
"description": "Vim emulation for Visual Studio Code",
"icon": "images/icon.png",
"version": "0.4.5",
"publisher": "vscodevim",
"galleryBanner": {
"color": "#e3f4ff",
"theme": "light"
},
"license": "MIT",
"keywords": [
"vim",
"vi",
"vscodevim"
],
"keybindings": [
{
"key": "Escape",
"command": "extension.vim_escape",
"when": "editorTextFocus && !inDebugRepl"
},
{
"key": "Home",
"command": "extension.vim_home",
"when": "editorTextFocus && !inDebugRepl && vim.mode != 'Insert Mode'"
},
{
"key": "End",
"command": "extension.vim_end",
"when": "editorTextFocus && !inDebugRepl && vim.mode != 'Insert Mode'"
},
{
"key": "cmd+left",
"command": "extension.vim_cmd+left",
"when": "editorTextFocus && !inDebugRepl && vim.mode != 'Insert Mode'"
},
{
"key": "cmd+right",
"command": "extension.vim_cmd+right",
"when": "editorTextFocus && !inDebugRepl && vim.mode != 'Insert Mode'"
},
{
"key": "cmd+d",
"command": "extension.vim_cmd+d",
"when": "editorTextFocus && !inDebugRepl"
},
{
"key": "cmd+a",
"command": "extension.vim_cmd+a",
"when": "editorTextFocus && !inDebugRepl && vim.mode != 'Insert Mode'"
},
{
"key": "ctrl+d",
"command": "extension.vim_ctrl+d",
"when": "editorTextFocus && vim.useCtrlKeys && !inDebugRepl"
},
{
"key": "ctrl+alt+down",
"linux": "shift+alt+down",
"mac": "cmd+alt+down",
"command": "extension.vim_cmd+alt+down",
"when": "editorTextFocus && !inDebugRepl"
},
{
"key": "ctrl+alt+up",
"linux": "shift+alt+up",
"mac": "cmd+alt+up",
"command": "extension.vim_cmd+alt+up",
"when": "editorTextFocus && !inDebugRepl"
},
{
"key": "Backspace",
"command": "extension.vim_backspace",
"when": "editorTextFocus && !inDebugRepl"
},
{
"key": "shift+backspace",
"command": "extension.vim_shift+backspace",
"when": "editorTextFocus && vim.mode == 'Search In Progress' && !inDebugRepl"
},
{
"key": "Delete",
"command": "extension.vim_delete",
"when": "editorTextFocus && vim.mode == 'Normal Mode' && !inDebugRepl"
},
{
"key": "tab",
"command": "extension.vim_tab",
"when": "editorFocus && vim.mode == 'Normal Mode' && !inDebugRepl"
},
{
"key": "ctrl+r",
"command": "extension.vim_ctrl+r",
"when": "editorTextFocus && !inDebugRepl"
},
{
"key": "ctrl+f",
"command": "extension.vim_ctrl+f",
"when": "editorTextFocus && vim.useCtrlKeys && !inDebugRepl"
},
{
"key": "ctrl+b",
"command": "extension.vim_ctrl+b",
"when": "editorTextFocus && vim.mode != 'Insert Mode' && !inDebugRepl"
},
{
"key": "ctrl+j",
"command": "extension.vim_ctrl+j",
"when": "editorTextFocus && vim.mode != 'Insert Mode' && !inDebugRepl"
},
{
"key": "ctrl+k",
"command": "extension.vim_ctrl+k",
"when": "editorTextFocus && vim.mode != 'Insert Mode' && !inDebugRepl"
},
{
"key": "ctrl+h",
"command": "extension.vim_ctrl+h",
"when": "editorTextFocus && vim.mode == 'Insert Mode' && !inDebugRepl"
},
{
"key": "ctrl+e",
"command": "extension.vim_ctrl+e",
"when": "editorTextFocus && vim.useCtrlKeys && !inDebugRepl"
},
{
"key": "ctrl+y",
"command": "extension.vim_ctrl+y",
"when": "editorTextFocus && vim.useCtrlKeys && !inDebugRepl"
},
{
"key": "ctrl+u",
"command": "extension.vim_ctrl+u",
"when": "editorTextFocus && !inDebugRepl"
},
{
"key": "ctrl+v",
"command": "extension.vim_ctrl+v",
"when": "editorTextFocus && vim.mode != 'Insert Mode' && vim.useCtrlKeys && !inDebugRepl"
},
{
"key": "cmd+v",
"command": "extension.vim_cmd+v",
"when": "editorTextFocus && vim.mode == 'Search In Progress' && !inDebugRepl"
},
{
"key": "ctrl+[",
"command": "extension.vim_ctrl+[",
"when": "editorTextFocus && vim.useCtrlKeys && !inDebugRepl"
},
{
"key": "ctrl+w",
"command": "extension.vim_ctrl+w",
"when": "editorTextFocus && !inDebugRepl"
},
{
"key": "ctrl+c",
"command": "extension.vim_ctrl+c",
"when": "editorTextFocus && vim.useCtrlKeys && !inDebugRepl"
},
{
"key": "ctrl+a",
"command": "extension.vim_ctrl+a",
"when": "editorTextFocus && vim.useCtrlKeys && !inDebugRepl"
},
{
"key": "ctrl+o",
"command": "extension.vim_ctrl+o",
"when": "editorTextFocus && vim.useCtrlKeys && !inDebugRepl"
},
{
"key": "ctrl+n",
"command": "extension.vim_ctrl+n",
"when": "suggestWidgetVisible"
},
{
"key": "ctrl+p",
"command": "extension.vim_ctrl+p",
"when": "suggestWidgetVisible"
},
{
"key": "ctrl+x",
"command": "extension.vim_ctrl+x",
"when": "editorTextFocus && vim.useCtrlKeys && !inDebugRepl"
},
{
"key": "ctrl+shift+2",
"command": "extension.vim_ctrl+shift+2",
"when": "editorTextFocus && vim.useCtrlKeys"
},
{
"key": "ctrl+t",
"command": "extension.vim_ctrl+t",
"when": "editorTextFocus && vim.useCtrlKeys && !inDebugRepl"
},
{
"key": "ctrl+pagedown",
"command": "extension.vim_ctrl+pagedown",
"when": "editorTextFocus && vim.useCtrlKeys && !inDebugRepl"
},
{
"key": "ctrl+pageup",
"command": "extension.vim_ctrl+pageup",
"when": "editorTextFocus && vim.useCtrlKeys && !inDebugRepl"
},
{
"key": "left",
"command": "extension.vim_left",
"when": "editorTextFocus && !inDebugRepl"
},
{
"key": "right",
"command": "extension.vim_right",
"when": "editorTextFocus && !inDebugRepl"
},
{
"key": "up",
"command": "extension.vim_up",
"when": "editorTextFocus && !inDebugRepl && !suggestWidgetVisible && !suggestWidgetMultipleSuggestions"
},
{
"key": "down",
"command": "extension.vim_down",
"when": "editorTextFocus && !inDebugRepl && !suggestWidgetVisible && !suggestWidgetMultipleSuggestions"
}
"repository": {
"type": "git",
"url": "https://github.com/VSCodeVim/Vim.git"
},
"homepage": "https://github.com/VSCodeVim/Vim",
"bugs": {
"url": "https://github.com/VSCodeVim/Vim/issues"
},
"engines": {
"vscode": "^1.6.0"
},
"categories": [
"Other",
"Keymaps"
],
"configuration": {
"title": "Vim Configuration",
"type": "object",
"properties": {
"vim.otherModesKeyBindings": {
"type": "array",
"description": "Keybinding overrides to use for normal mode."
},
"vim.otherModesKeyBindingsNonRecursive": {
"type": "array",
"description": "Non-recursive keybinding overrides to use for normal mode."
},
"vim.useCtrlKeys": {
"type": "boolean",
"description": "Enable some vim ctrl key commands that override otherwise common operations, like ctrl+c",
"default": true
},
"vim.useSystemClipboard": {
"type": "boolean",
"description": "Use system clipboard for unnamed register.",
"default": false
},
"vim.insertModeKeyBindings": {
"type": "array",
"description": "Keybinding overrides to use for insert mode."
},
"vim.insertModeKeyBindingsNonRecursive": {
"type": "array",
"description": "Non-recursive keybinding overrides to use for insert mode."
},
"vim.useSolidBlockCursor": {
"type": "boolean",
"description": "Use a non blinking block cursor.",
"default": false
},
"vim.scroll": {
"type": "number",
"description": "Number of lines to scroll with CTRL-U and CTRL-D commands.",
"default": 20
},
"vim.iskeyword": {
"type": "string",
"description": "keywords contain alphanumeric characters and '_'",
"default": "/\\()\"':,.;<>~!@#$%^&*|+=[]{}`?-"
},
"vim.textwidth": {
"type": "number",
"description": "Width to word-wrap to when using gq.",
"default": 80
},
"vim.ignorecase": {
"type": "boolean",
"description": "Ignore case in search patterns.",
"default": true
},
"vim.smartcase": {
"type": "boolean",
"description": "Override the 'ignorecase' option if the search pattern contains upper case characters.",
"default": true
},
"vim.easymotion": {
"type": "boolean",
"description": "Enable the EasyMotion plugin for Vim.",
"default": false
},
"vim.hlsearch": {
"type": "boolean",
"description": "Show all matches of the most recent search pattern",
"default": false
},
"vim.incsearch": {
"type": "boolean",
"description": "Show where a / search matches as you type it.",
"default": true
},
"vim.autoindent": {
"type": "boolean",
"description": "Indent code automatically.",
"default": true
},
"vim.startInInsertMode": {
"type": "boolean",
"description": "Start in Insert Mode."
"activationEvents": [
"*"
],
"main": "./out/extension",
"contributes": {
"commands": [
{
"command": "extension.showCmdLine",
"title": "Vim: Show Command Line"
}
],
"keybindings": [
{
"key": "Escape",
"command": "extension.vim_escape",
"when": "editorTextFocus && !inDebugRepl"
},
{
"key": "Home",
"command": "extension.vim_home",
"when": "editorTextFocus && !inDebugRepl && vim.mode != 'Insert Mode'"
},
{
"key": "End",
"command": "extension.vim_end",
"when": "editorTextFocus && !inDebugRepl && vim.mode != 'Insert Mode'"
},
{
"key": "cmd+left",
"command": "extension.vim_cmd+left",
"when": "editorTextFocus && !inDebugRepl && vim.mode != 'Insert Mode'"
},
{
"key": "cmd+right",
"command": "extension.vim_cmd+right",
"when": "editorTextFocus && !inDebugRepl && vim.mode != 'Insert Mode'"
},
{
"key": "cmd+d",
"command": "extension.vim_cmd+d",
"when": "editorTextFocus && !inDebugRepl"
},
{
"key": "cmd+a",
"command": "extension.vim_cmd+a",
"when": "editorTextFocus && !inDebugRepl && vim.mode != 'Insert Mode'"
},
{
"key": "ctrl+d",
"command": "extension.vim_ctrl+d",
"when": "editorTextFocus && vim.useCtrlKeys && !inDebugRepl"
},
{
"key": "ctrl+alt+down",
"linux": "shift+alt+down",
"mac": "cmd+alt+down",
"command": "extension.vim_cmd+alt+down",
"when": "editorTextFocus && !inDebugRepl"
},
{
"key": "ctrl+alt+up",
"linux": "shift+alt+up",
"mac": "cmd+alt+up",
"command": "extension.vim_cmd+alt+up",
"when": "editorTextFocus && !inDebugRepl"
},
{
"key": "Backspace",
"command": "extension.vim_backspace",
"when": "editorTextFocus && !inDebugRepl"
},
{
"key": "shift+backspace",
"command": "extension.vim_shift+backspace",
"when": "editorTextFocus && vim.mode == 'Search In Progress' && !inDebugRepl"
},
{
"key": "Delete",
"command": "extension.vim_delete",
"when": "editorTextFocus && vim.mode == 'Normal Mode' && !inDebugRepl"
},
{
"key": "tab",
"command": "extension.vim_tab",
"when": "editorFocus && vim.mode == 'Normal Mode' && !inDebugRepl"
},
{
"key": "ctrl+r",
"command": "extension.vim_ctrl+r",
"when": "editorTextFocus && !inDebugRepl"
},
{
"key": "ctrl+f",
"command": "extension.vim_ctrl+f",
"when": "editorTextFocus && vim.useCtrlKeys && !inDebugRepl"
},
{
"key": "ctrl+b",
"command": "extension.vim_ctrl+b",
"when": "editorTextFocus && vim.mode != 'Insert Mode' && !inDebugRepl"
},
{
"key": "ctrl+j",
"command": "extension.vim_ctrl+j",
"when": "editorTextFocus && vim.mode != 'Insert Mode' && !inDebugRepl"
},
{
"key": "ctrl+k",
"command": "extension.vim_ctrl+k",
"when": "editorTextFocus && vim.mode != 'Insert Mode' && !inDebugRepl"
},
{
"key": "ctrl+h",
"command": "extension.vim_ctrl+h",
"when": "editorTextFocus && vim.mode == 'Insert Mode' && !inDebugRepl"
},
{
"key": "ctrl+e",
"command": "extension.vim_ctrl+e",
"when": "editorTextFocus && vim.useCtrlKeys && !inDebugRepl"
},
{
"key": "ctrl+y",
"command": "extension.vim_ctrl+y",
"when": "editorTextFocus && vim.useCtrlKeys && !inDebugRepl"
},
{
"key": "ctrl+u",
"command": "extension.vim_ctrl+u",
"when": "editorTextFocus && !inDebugRepl"
},
{
"key": "ctrl+v",
"command": "extension.vim_ctrl+v",
"when": "editorTextFocus && vim.mode != 'Insert Mode' && vim.useCtrlKeys && !inDebugRepl"
},
{
"key": "cmd+v",
"command": "extension.vim_cmd+v",
"when": "editorTextFocus && vim.mode == 'Search In Progress' && !inDebugRepl"
},
{
"key": "ctrl+[",
"command": "extension.vim_ctrl+[",
"when": "editorTextFocus && vim.useCtrlKeys && !inDebugRepl"
},
{
"key": "ctrl+w",
"command": "extension.vim_ctrl+w",
"when": "editorTextFocus && !inDebugRepl"
},
{
"key": "ctrl+c",
"command": "extension.vim_ctrl+c",
"when": "editorTextFocus && vim.useCtrlKeys && !inDebugRepl"
},
{
"key": "ctrl+a",
"command": "extension.vim_ctrl+a",
"when": "editorTextFocus && vim.useCtrlKeys && !inDebugRepl"
},
{
"key": "ctrl+o",
"command": "extension.vim_ctrl+o",
"when": "editorTextFocus && vim.useCtrlKeys && !inDebugRepl"
},
{
"key": "ctrl+n",
"command": "extension.vim_ctrl+n",
"when": "suggestWidgetVisible"
},
{
"key": "ctrl+p",
"command": "extension.vim_ctrl+p",
"when": "suggestWidgetVisible"
},
{
"key": "ctrl+x",
"command": "extension.vim_ctrl+x",
"when": "editorTextFocus && vim.useCtrlKeys && !inDebugRepl"
},
{
"key": "ctrl+shift+2",
"command": "extension.vim_ctrl+shift+2",
"when": "editorTextFocus && vim.useCtrlKeys"
},
{
"key": "ctrl+t",
"command": "extension.vim_ctrl+t",
"when": "editorTextFocus && vim.useCtrlKeys && !inDebugRepl"
},
{
"key": "ctrl+pagedown",
"command": "extension.vim_ctrl+pagedown",
"when": "editorTextFocus && vim.useCtrlKeys && !inDebugRepl"
},
{
"key": "ctrl+pageup",
"command": "extension.vim_ctrl+pageup",
"when": "editorTextFocus && vim.useCtrlKeys && !inDebugRepl"
},
{
"key": "left",
"command": "extension.vim_left",
"when": "editorTextFocus && !inDebugRepl"
},
{
"key": "right",
"command": "extension.vim_right",
"when": "editorTextFocus && !inDebugRepl"
},
{
"key": "up",
"command": "extension.vim_up",
"when": "editorTextFocus && !inDebugRepl && !suggestWidgetVisible && !suggestWidgetMultipleSuggestions"
},
{
"key": "down",
"command": "extension.vim_down",
"when": "editorTextFocus && !inDebugRepl && !suggestWidgetVisible && !suggestWidgetMultipleSuggestions"
}
],
"configuration": {
"title": "Vim Configuration",
"type": "object",
"properties": {
"vim.otherModesKeyBindings": {
"type": "array",
"description": "Keybinding overrides to use for normal mode."
},
"vim.otherModesKeyBindingsNonRecursive": {
"type": "array",
"description": "Non-recursive keybinding overrides to use for normal mode."
},
"vim.useCtrlKeys": {
"type": "boolean",
"description": "Enable some vim ctrl key commands that override otherwise common operations, like ctrl+c",
"default": true
},
"vim.useSystemClipboard": {
"type": "boolean",
"description": "Use system clipboard for unnamed register.",
"default": false
},
"vim.insertModeKeyBindings": {
"type": "array",
"description": "Keybinding overrides to use for insert mode."
},
"vim.insertModeKeyBindingsNonRecursive": {
"type": "array",
"description": "Non-recursive keybinding overrides to use for insert mode."
},
"vim.textwidth": {
"type": "number",
"description": "Width to word-wrap to when using gq.",
"default": 80
},
"vim.useSolidBlockCursor": {
"type": "boolean",
"description": "Use a non blinking block cursor.",
"default": false
},
"vim.scroll": {
"type": "number",
"description": "Number of lines to scroll with CTRL-U and CTRL-D commands.",
"default": 20
},
"vim.iskeyword": {
"type": "string",
"description": "keywords contain alphanumeric characters and '_'",
"default": "/\\()\"':,.;<>~!@#$%^&*|+=[]{}`?-"
},
"vim.ignorecase": {
"type": "boolean",
"description": "Ignore case in search patterns.",
"default": true
},
"vim.smartcase": {
"type": "boolean",
"description": "Override the 'ignorecase' option if the search pattern contains upper case characters.",
"default": true
},
"vim.easymotion": {
"type": "boolean",
"description": "Enable the EasyMotion plugin for Vim.",
"default": false
},
"vim.hlsearch": {
"type": "boolean",
"description": "Show all matches of the most recent search pattern",
"default": false
},
"vim.incsearch": {
"type": "boolean",
"description": "Show where a / search matches as you type it.",
"default": true
},
"vim.autoindent": {
"type": "boolean",
"description": "Indent code automatically.",
"default": true
},
"vim.startInInsertMode": {
"type": "boolean",
"description": "Start in Insert Mode."
}
}
}
}
},
"scripts": {
"vscode:prepublish": "node ./node_modules/vscode/bin/compile -p ./",
"compile": "node ./node_modules/vscode/bin/compile -watch -p ./",
"test": "node ./node_modules/vscode/bin/test",
"postinstall": "node ./node_modules/vscode/bin/install && gulp init"
},
"dependencies": {
"child-process": "^1.0.2",
"copy-paste": "^1.3.0",
"diff-match-patch": "^1.0.0",
"lodash": "^4.12.0",
"typescript": "^2.2.0-dev.20161203",
"vscode": "^0.11.16"
},
"devDependencies": {
"gulp": "^3.9.1",
"gulp-bump": "^2.1.0",
"gulp-git": "^1.7.1",
"gulp-inject-string": "^1.1.0",
"gulp-shell": "^0.5.2",
"gulp-tag-version": "^1.3.0",
"gulp-tslint": "^6.1.2",
"gulp-typings": "^2.0.0",
"merge-stream": "^1.0.0",
"tslint": "^3.10.2",
"typescript": "^2.2.0-dev.20161203",
"typings": "^1.4.0"
}
},
"scripts": {
"vscode:prepublish": "node ./node_modules/vscode/bin/compile -p ./",
"compile": "node ./node_modules/vscode/bin/compile -watch -p ./",
"test": "node ./node_modules/vscode/bin/test",
"postinstall": "node ./node_modules/vscode/bin/install && gulp init"
},
"dependencies": {
"child-process": "^1.0.2",
"copy-paste": "^1.3.0",
"diff-match-patch": "^1.0.0",
"lodash": "^4.12.0",
"typescript": "^2.2.0-dev.20161203",
"vscode": "^0.11.16"
},
"devDependencies": {
"gulp": "^3.9.1",
"gulp-bump": "^2.1.0",
"gulp-git": "^1.7.1",
"gulp-inject-string": "^1.1.0",
"gulp-shell": "^0.5.2",
"gulp-tag-version": "^1.3.0",
"gulp-tslint": "^6.1.2",
"gulp-typings": "^2.0.0",
"merge-stream": "^1.0.0",
"tslint": "^3.10.2",
"typescript": "2.0.0",
"typings": "^1.4.0"
}
}

View File

@ -29,7 +29,7 @@ export class SearchState {
return this._searchCursorStartPosition;
}
private _matchesDocVersion: number;
private _cachedDocumentVersion: number;
private _searchDirection: SearchDirection = SearchDirection.Forward;
private isRegex: boolean;
@ -47,12 +47,14 @@ export class SearchState {
private _recalculateSearchRanges({ forceRecalc }: { forceRecalc?: boolean } = {}): void {
const search = this.searchString;
const selection = vscode.window.activeTextEditor.selection;
const lineToStartAt = Math.min(selection.start.line, selection.end.line);
if (search === "") { return; }
if (this._matchesDocVersion !== TextEditor.getDocumentVersion() || forceRecalc) {
if (this._cachedDocumentVersion !== TextEditor.getDocumentVersion() || forceRecalc) {
// Calculate and store all matching ranges
this._matchesDocVersion = TextEditor.getDocumentVersion();
this._cachedDocumentVersion = TextEditor.getDocumentVersion();
this._matchRanges = [];
/*
@ -83,8 +85,11 @@ export class SearchState {
regex = new RegExp(searchRE, regexFlags);
}
let lineIdx = lineToStartAt;
// Start at the current line and wrap the document if we hit the end.
outer:
for (let lineIdx = 0; lineIdx < TextEditor.getLineCount(); lineIdx++) {
do {
const line = TextEditor.getLineAt(new Position(lineIdx, 0)).text;
let result = regex.exec(line);
@ -104,7 +109,13 @@ export class SearchState {
result = regex.exec(line);
}
}
lineIdx === TextEditor.getLineCount() - 1 ? lineIdx = 0 : lineIdx++;
} while (lineIdx !== lineToStartAt);
this._matchRanges.sort((x, y) =>
x.start.line < y.start.line ||
x.start.line === y.start.line && x.start.character < y.start.character ? -1 : 1);
}
}
@ -113,7 +124,7 @@ export class SearchState {
*
* Pass in -1 as direction to reverse the direction we search.
*/
public getNextSearchMatchPosition(startPosition: Position, direction = 1): { pos: Position, match: boolean} {
public getNextSearchMatchPosition(startPosition: Position, direction = 1): { pos: Position, match: boolean } {
this._recalculateSearchRanges();
if (this._matchRanges.length === 0) {