Fix wrong line separators in IntellijEditorTextField document creation#934
Fix wrong line separators in IntellijEditorTextField document creation#934
IntellijEditorTextField document creation#934Conversation
WalkthroughThe pull request addresses an issue with incorrect line separators in document creation. The fix normalizes line endings in input text before it is used in document initialization and updates. This involves converting line separators to the system-appropriate format and consistently using the normalized text value across document creation, editor operations, and effect dependencies. The changes are focused on ensuring proper line ending handling throughout the component lifecycle. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment Tip CodeRabbit can enforce grammar and style rules using `languagetool`.Configure the |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In
`@tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/jewel/editor/IntellijEditorTextField.kt`:
- Around line 130-136: The LaunchedEffect currently only depends on
normalizedText, so when document is null it returns early and won't re-run once
the document is created; update the LaunchedEffect key tuple to include document
(e.g., LaunchedEffect(normalizedText, document)) so the effect re-executes when
the document becomes available and then performs the edtWriteAction {
doc.setText(normalizedText) } to sync text; locate the LaunchedEffect block that
references normalizedText and document in IntellijEditorTextField and add
document to its dependency keys.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 9774d48e-8989-4904-977d-92211fde12c6
📒 Files selected for processing (2)
tools/idea-plugin/CHANGELOG.mdtools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/jewel/editor/IntellijEditorTextField.kt
📝 Changelog
If this PR introduces user-facing changes, please update the relevant Unreleased section in changelogs: