Skip to content

Commit

Permalink
fix auto new lines
Browse files Browse the repository at this point in the history
  • Loading branch information
rjmacarthy committed Apr 4, 2024
1 parent 6d57c1d commit 920aee9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/extension/completion-formatter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,11 +161,11 @@ export class CompletionFormatter {
return this
}

private preventDuplicateLines = (): CompletionFormatter => {
private preventDuplicateLine = (): CompletionFormatter => {
const lineCount = this._editor.document.lineCount
let nextLineIndex = this._cursorPosition.line + 1
while (
nextLineIndex < this._cursorPosition.line + 3 &&
nextLineIndex < this._cursorPosition.line + 1 &&
nextLineIndex < lineCount
) {
const line = this._editor.document.lineAt(nextLineIndex)
Expand Down Expand Up @@ -265,7 +265,7 @@ export class CompletionFormatter {
line
)
const isComment = line.startsWith(languageId.syntaxComments.start)
return !(startsWithComment && includesCommentReference) && !isComment && line.length
return !(startsWithComment && includesCommentReference) && !isComment
})

if (completionLines.length) {
Expand All @@ -288,7 +288,7 @@ export class CompletionFormatter {
this._originalCompletion = completion
const infillText = this.matchCompletionBrackets()
.preventQuotationCompletions()
.preventDuplicateLines()
.preventDuplicateLine()
.removeDuplicateQuotes()
.removeUnnecessaryMiddleQuote()
.ignoreBlankLines()
Expand Down

0 comments on commit 920aee9

Please sign in to comment.