Skip to content

Commit 7fa66b9

Browse files
Tomasz KądziołkaTomasz Kądziołka
authored andcommitted
Corrected not tokenized code
1 parent 00399e2 commit 7fa66b9

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

flutter_module/lib/presentation/widgets/snippet_action_bar.dart

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,7 @@ class SnippetActionBar extends StatelessWidget {
4444
StateIcon(
4545
icon: Icons.save_alt_outlined,
4646
active: snippet.isSaved,
47-
onTap: snippet.isSaved == false
48-
? null
49-
: getSaveCallback(snippet.isSaved, onSaveTap),
47+
onTap: getSaveCallback(snippet.isSaved, onSaveTap),
5048
),
5149
const SizedBox(width: Dimens.l),
5250
StateIcon(

flutter_module/lib/utils/extensions/collection_extensions.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ extension SyntaxSpanExtension on List<SyntaxToken?>? {
5454
final tokenIndices =
5555
uniqueTokens.expand((token) => [token.start, token.end]).toList();
5656

57-
final phrases = text.splitByIndices(tokenIndices);
57+
final phrases =
58+
tokenIndices.isNotEmpty ? text.splitByIndices(tokenIndices) : [text];
5859

5960
return phrases.map((phrase) {
6061
TextStyle style = baseStyle;

0 commit comments

Comments
 (0)