Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/src/code/reg_exp.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
class RegExps {
static final wordSplit = RegExp('[^_a-zA-Z0-9]+');
static final wordSplit = RegExp(r'[^_a-zA-Z0-9\u0600-\u06FF]+');
}
27 changes: 16 additions & 11 deletions lib/src/code_field/code_field.dart
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ class CodeField extends StatefulWidget {
final Color? background;
final EdgeInsets padding;
final Decoration? decoration;
final TextDirection textDirection;
final TextSelectionThemeData? textSelectionTheme;
final FocusNode? focusNode;

Expand All @@ -196,6 +197,7 @@ class CodeField extends StatefulWidget {
this.smartQuotesType = SmartQuotesType.disabled,
this.padding = EdgeInsets.zero,
GutterStyle? gutterStyle,
this.textDirection = TextDirection.ltr,
this.enabled,
this.readOnly = false,
this.cursorColor,
Expand Down Expand Up @@ -434,6 +436,7 @@ class _CodeFieldState extends State<CodeField> {
maxLines: widget.maxLines,
expands: widget.expands,
scrollController: _codeScroll,
textDirection: widget.textDirection,
decoration: const InputDecoration(
isCollapsed: true,
contentPadding: EdgeInsets.symmetric(vertical: 16),
Expand Down Expand Up @@ -464,17 +467,19 @@ class _CodeFieldState extends State<CodeField> {
return FocusableActionDetector(
actions: widget.controller.actions,
shortcuts: _shortcuts,
child: Container(
decoration: widget.decoration,
color: _backgroundCol,
key: _codeFieldKey,
padding: const EdgeInsets.only(left: 8),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
if (widget.gutterStyle.showGutter) _buildGutter(),
Expanded(key: _editorKey, child: editingField),
],
child: Directionality(
textDirection: widget.textDirection,
child: Container(
decoration: widget.decoration,
color: _backgroundCol,
key: _codeFieldKey,
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
if (widget.gutterStyle.showGutter) _buildGutter(),
Expanded(key: _editorKey, child: editingField),
],
),
),
),
);
Expand Down