Skip to content

Commit

Permalink
fix(intellij): fix line number when navigate to file context. (#3486)
Browse files Browse the repository at this point in the history
  • Loading branch information
icycodes authored Nov 28, 2024
1 parent d8eeeb6 commit 93202d9
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,8 @@ class ChatBrowser(private val project: Project) : JBCefBrowser(
?: project.guessProjectDir()?.url?.let { project.findVirtualFile(it.appendUrlPathSegments(fileContext.filepath)) }
?: return
invokeLater {
val descriptor = OpenFileDescriptor(project, virtualFile, fileContext.range.start, 0)
val lineNumber = (fileContext.range.start - 1).coerceAtLeast(0)
val descriptor = OpenFileDescriptor(project, virtualFile, lineNumber, 0)
FileEditorManager.getInstance(project).openTextEditor(descriptor, true)
}
}
Expand Down

0 comments on commit 93202d9

Please sign in to comment.