Skip to content

Commit e3cbda7

Browse files
committed
fix(prompts): invalid caret position in prompt preview
1 parent e9996f1 commit e3cbda7

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
- Open AI configuration setting `organizationId` is not used when verifying configuration.
1717
- Gemini configuration settings `projectId` and `location` are not used when verifying configuration.
1818
- Notification about common branch is shown after the prompt dialog is closed.
19+
- Invalid caret position for prompt preview.
1920

2021
## [2.4.1] - 2024-09-19
2122

src/main/kotlin/com/github/blarc/ai/commits/intellij/plugin/settings/prompts/PromptTable.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ class PromptTable(private val cs: CoroutineScope) {
214214
private fun setPreview(promptContent: String, hint: String) {
215215
val constructPrompt = AICommitsUtils.constructPrompt(promptContent, diff, branch, hint, project)
216216
promptPreviewTextArea.text = constructPrompt.substring(0, constructPrompt.length.coerceAtMost(10000))
217-
promptPreviewTextArea.caretPosition = max(0, promptContentTextArea.caretPosition - 10)
217+
promptPreviewTextArea.caretPosition = max(0, promptPreviewTextArea.caretPosition - 10)
218218
}
219219

220220
}

0 commit comments

Comments
 (0)