Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion findJump/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,23 @@
"command": "findJump.activateWithSelection",
"title": "Activate Find-Jump in selection mode"
}
]
],
"configuration": {
"title": "Find-Jump",
"properties": {
"findJump.jumpCursorPosition": {
"type": "string",
"default": "start",
"enum": [
"start",
"end"
],
"enumDescriptions": [
"Place where to put cursor: before searching range or after"
]
}
}
}
},
"scripts": {
"vscode:prepublish": "tsc -p ./",
Expand Down
5 changes: 4 additions & 1 deletion findJump/src/findJump.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
TextEditor,
TextLine,
Range,
workspace
} from 'vscode'
import {InlineInput} from './inlineInput'
import {documentRippleScanner} from './documentRippleScanner'
Expand All @@ -22,6 +23,7 @@ export class FindJump {
activityIndicatorState = 0
activatedWithSelection = false
searchFunctionDebounceTracker: any
workspaceFindJumpConfig = workspace.getConfiguration('findJump');

activate = (textEditor: TextEditor) => {
this.textEditor = textEditor
Expand Down Expand Up @@ -96,7 +98,8 @@ export class FindJump {
return
}

const {line, character} = range.start
const cursorPosition = this.workspaceFindJumpConfig.get('jumpCursorPosition', 'start');
const {line, character} = this.activatedWithSelection ? range.start : range[cursorPosition]

this.textEditor.selection = new Selection(
this.activatedWithSelection ? this.textEditor.selection.start.line : line,
Expand Down