new: setting of editor highlight
This commit is contained in:
@@ -57,10 +57,12 @@ class _EditorPageState extends State<EditorPage> {
|
||||
super.initState();
|
||||
|
||||
/// Higher priority than [path]
|
||||
_langCode = widget.langCode ?? Highlights.getCode(widget.path);
|
||||
_controller = CodeController(
|
||||
language: Highlights.all[_langCode],
|
||||
);
|
||||
if (Stores.setting.editorHighlight.fetch()) {
|
||||
_langCode = widget.langCode ?? Highlights.getCode(widget.path);
|
||||
}
|
||||
_controller = CodeController(
|
||||
language: Highlights.all[_langCode],
|
||||
);
|
||||
|
||||
/// TODO: This is a temporary solution to avoid the loading stuck
|
||||
Future.delayed(const Duration(milliseconds: 377)).then((value) async {
|
||||
|
||||
@@ -245,6 +245,7 @@ class _SettingPageState extends State<SettingPage> {
|
||||
_buildEditorFontSize(),
|
||||
_buildEditorTheme(),
|
||||
_buildEditorDarkTheme(),
|
||||
_buildEditorHighlight(),
|
||||
].map((e) => RoundRectCard(e)).toList(),
|
||||
);
|
||||
}
|
||||
@@ -1072,4 +1073,12 @@ class _SettingPageState extends State<SettingPage> {
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildEditorHighlight() {
|
||||
return ListTile(
|
||||
title: Text(l10n.highlight),
|
||||
subtitle: Text(l10n.editorHighlightTip, style: UIs.textGrey),
|
||||
trailing: StoreSwitch(prop: _setting.editorHighlight),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user