Skip to content

Commit

Permalink
Merge pull request #82349 from yamachu/fix/suggest-over-remove
Browse files Browse the repository at this point in the history
Fixed the problem of overwriting many characters in suggestion
  • Loading branch information
joaomoreno committed Oct 11, 2019
2 parents 4425701 + d952f6b commit a698117
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/vs/editor/contrib/suggest/suggestController.ts
Expand Up @@ -265,15 +265,15 @@ export class SuggestController implements IEditorContribution {

let overwriteBefore = position.column - suggestion.range.startColumn;
let overwriteAfter = suggestion.range.endColumn - position.column;
let suffixDelta = this._lineSuffix.value ? this._lineSuffix.value.delta(position) : 0;
let suffixDelta = this._lineSuffix.value ? this._lineSuffix.value.delta(editorPosition) : 0;
let word: IWordAtPosition | null;
if (!keepSuffix) {
// don't overwrite anything right of the cursor
overwriteAfter = 0;

} else if (overwriteAfter === 0 && (word = model.getWordAtPosition(position))) {
// compute fallback overwrite length
overwriteAfter = word.endColumn - position.column;
overwriteAfter = word.endColumn - editorPosition.column;
}

SnippetController2.get(this._editor).insert(insertText, {
Expand Down

0 comments on commit a698117

Please sign in to comment.