Skip to content

Commit 23cf14a

Browse files
committed
adjust content position calculation for RTL support
1 parent e7dc5fe commit 23cf14a

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

lib/code_forge/code_area.dart

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5799,11 +5799,6 @@ class _CodeFieldRenderer extends RenderBox implements MouseTrackerAnnotation {
57995799

58005800
final hasActiveFolds = _hasActiveFolds;
58015801

5802-
// For buffered edits that include newlines, using a single multi-line
5803-
// buffer paragraph can place the caret one visual line behind. Keep caret
5804-
// mapping aligned with gutter by always resolving logical line/column
5805-
// through offset-based controller helpers.
5806-
58075802
if (!isRTL && _caretInfoCache.containsKey(cursorOffset)) {
58085803
return _caretInfoCache[cursorOffset]!;
58095804
}
@@ -10118,7 +10113,7 @@ class _CodeFieldRenderer extends RenderBox implements MouseTrackerAnnotation {
1011810113
_currentPosition = localPosition;
1011910114

1012010115
final contentX = localPosition.dx -
10121-
_gutterWidth -
10116+
(isRTL ? 0 : _gutterWidth) -
1012210117
(innerPadding?.left ?? 0) +
1012310118
(lineWrap ? 0 : _effectiveHScroll);
1012410119
final contentPosition = Offset(

0 commit comments

Comments
 (0)