Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Fixed an issue where the completion was abnormal in some scenarios #806

Merged
merged 1 commit into from
Jul 24, 2024

Conversation

Kakueeen
Copy link
Contributor

as title

Log: fix issue

@deepin-ci-robot
Copy link

deepin pr auto review

关键摘要:

  • CodeCompletionModel::range()函数中,当d->completionDatas.first().textEdit.newText.isEmpty()为真时,返回空范围,可能导致后续处理错误。
  • executeWithTextEditexecuteWithoutTextEdit函数中,对于textToInsert的遍历使用了逆序,这可能会改变插入文本的顺序,需要确认这是否是预期的行为。
  • executeWithoutTextEdit函数中,对于editor()->text(lineStartPos, pos)的获取使用了pos而不是pos - length - 1,这可能会导致文本的错误比较。
  • executeWithoutTextEdit函数中,对于editor()->cursorPosition()的获取使用了pos而不是pos - length,这可能会导致光标位置不正确。
  • executeWithoutTextEdit函数中,对于editor()->replaceRange(pos - length, pos, textToInsert)的调用,如果length为0,则会替换整个行,这可能不是预期的行为。
  • executeWithTextEdit函数中,对于editor()->SendScintilla(TextEditor::SCI_GETCHARAT, pos - length - 1)的调用,如果length为0,则会尝试获取字符串末尾的字符,这可能不是预期的行为。
  • executeWithTextEdit函数中,对于editor()->SendScintilla(TextEditor::SCI_POSITIONFROMLINE, line)的调用,如果line为0,则会返回0,这可能不是预期的行为。

是否建议立即修改:

@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Kakueeen, LiHua000
Once this PR has been reviewed and has the lgtm label, please assign toberyan for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@deepin-mozart deepin-mozart merged commit 8455c15 into linuxdeepin:develop/main Jul 24, 2024
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants