|
@@ -123,7 +123,7 @@ class _CodeBlockComponentWidgetState extends State<CodeBlockComponentWidget>
|
|
|
'BASIC',
|
|
|
'C',
|
|
|
'C#',
|
|
|
- 'C++',
|
|
|
+ 'CPP',
|
|
|
'Clojure',
|
|
|
'CSS',
|
|
|
'Dart',
|
|
@@ -167,7 +167,10 @@ class _CodeBlockComponentWidgetState extends State<CodeBlockComponentWidget>
|
|
|
.map((e) => e.toLowerCase())
|
|
|
.toSet()
|
|
|
.intersection(allLanguages.keys.toSet())
|
|
|
- .toList();
|
|
|
+ .toList()
|
|
|
+ ..add('auto')
|
|
|
+ ..add('c')
|
|
|
+ ..sort();
|
|
|
|
|
|
late final editorState = context.read<EditorState>();
|
|
|
|
|
@@ -253,7 +256,7 @@ class _CodeBlockComponentWidgetState extends State<CodeBlockComponentWidget>
|
|
|
alignment: Alignment.centerLeft,
|
|
|
padding: const EdgeInsets.symmetric(horizontal: 4),
|
|
|
child: FlowyTextButton(
|
|
|
- '${language?.capitalize() ?? 'auto'} ',
|
|
|
+ '${language?.capitalize() ?? 'Auto'} ',
|
|
|
padding: const EdgeInsets.symmetric(
|
|
|
horizontal: 12.0,
|
|
|
vertical: 4.0,
|
|
@@ -281,7 +284,7 @@ class _CodeBlockComponentWidgetState extends State<CodeBlockComponentWidget>
|
|
|
Future<void> updateLanguage(String language) async {
|
|
|
final transaction = editorState.transaction
|
|
|
..updateNode(node, {
|
|
|
- CodeBlockKeys.language: language,
|
|
|
+ CodeBlockKeys.language: language == 'auto' ? null : language,
|
|
|
})
|
|
|
..afterSelection = Selection.collapse(
|
|
|
node.path,
|