mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
ui: add option for autoFormat
This commit is contained in:
1 parent
5db35700f3
commit
994634947e
3 files changed
+18
-12
No files matched your search
@@ -5,7 +5,7 @@ import Notification from 'vj/components/notification/index';
|
||||
const highlighterPage = new AutoloadPage('highlighterPage', async () => {
|
||||
const [{ default: prismjs }, [success, format]] = await Promise.all([
|
||||
import('./prismjs'),
|
||||
load(),
|
||||
UserContext.formatCode ? load() : [true, null],
|
||||
]);
|
||||
if (!success) Notification.error(`Astyle load fail: ${format}`);
|
||||
function runHighlight($container) {
|
||||
|
||||
@@ -86,6 +86,12 @@ showInvisibleChar:
|
||||
family: highlight
|
||||
desc: show invisible characters when formatting code
|
||||
category: preference
|
||||
formatCode:
|
||||
type: boolean
|
||||
family: highlight
|
||||
desc: Auto format code
|
||||
category: preference
|
||||
value: true
|
||||
astyleOptions:
|
||||
type: text
|
||||
family: highlight
|
||||
|
||||
Reference in new issue
Block a user