File tree Expand file tree Collapse file tree
src/vs/editor/contrib/suggest Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -234,11 +234,12 @@ export class SuggestController implements IEditorContribution {
234234 }
235235
236236 const overwriteBefore = position . column - suggestion . range . startColumn ;
237- const overwriteAfter = ( suggestion . range . endColumn - position . column ) + this . _lineSuffix . value ! . delta ( this . _editor . getPosition ( ) ) ;
237+ const overwriteAfter = suggestion . range . endColumn - position . column ;
238+ const suffixDelta = this . _lineSuffix . value ? this . _lineSuffix . value . delta ( this . _editor . getPosition ( ) ) : 0 ;
238239
239240 SnippetController2 . get ( this . _editor ) . insert ( insertText , {
240241 overwriteBefore : overwriteBefore + columnDelta ,
241- overwriteAfter,
242+ overwriteAfter : overwriteAfter + suffixDelta ,
242243 undoStopBefore : false ,
243244 undoStopAfter : false ,
244245 adjustWhitespace : ! ( suggestion . insertTextRules ! & CompletionItemInsertTextRule . KeepWhitespace )
You can’t perform that action at this time.
0 commit comments