Skip to content

Commit 1aabcce

Browse files
committed
improvement: specify tab size
1 parent e17a077 commit 1aabcce

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

flutter_highlight/lib/flutter_highlight.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,13 @@ class HighlightView extends StatelessWidget {
2828
final TextStyle textStyle;
2929

3030
HighlightView(
31-
this.source, {
31+
String input, {
3232
this.language,
3333
this.theme = const {},
3434
this.padding,
3535
this.textStyle,
36-
});
36+
int tabSize = 8, // TODO: https://github.com/flutter/flutter/issues/50087
37+
}) : source = input.replaceAll('\t', ' ' * tabSize);
3738

3839
List<TextSpan> _convert(List<Node> nodes) {
3940
List<TextSpan> spans = [];

0 commit comments

Comments
 (0)