Implements #51: Folding commands
This commit is contained in:
@@ -369,6 +369,30 @@ functions:
|
||||
path: ./embed.ts:embedWidget
|
||||
codeWidget: embed
|
||||
|
||||
# Folding commands
|
||||
foldCommand:
|
||||
path: ./editor.ts:foldCommand
|
||||
command:
|
||||
name: "Fold: Fold"
|
||||
mac: "Cmd-Alt-["
|
||||
key: "Ctrl-Shift-["
|
||||
unfoldCommand:
|
||||
path: ./editor.ts:unfoldCommand
|
||||
command:
|
||||
name: "Fold: Unfold"
|
||||
mac: "Cmd-Alt-]"
|
||||
key: "Ctrl-Shift-]"
|
||||
foldAllCommand:
|
||||
path: ./editor.ts:foldAllCommand
|
||||
command:
|
||||
name: "Fold: Fold All"
|
||||
key: "Ctrl-Alt-["
|
||||
unfoldAllCommand:
|
||||
path: ./editor.ts:unfoldAllCommand
|
||||
command:
|
||||
name: "Fold: Unfold All"
|
||||
key: "Ctrl-Alt-]"
|
||||
|
||||
# Random stuff
|
||||
statsCommand:
|
||||
path: ./stats.ts:statsCommand
|
||||
|
||||
@@ -17,3 +17,19 @@ export async function toggleDarkMode() {
|
||||
await editor.setUiOption("darkMode", darkMode);
|
||||
await store.set("darkMode", darkMode);
|
||||
}
|
||||
|
||||
export async function foldCommand() {
|
||||
await editor.fold();
|
||||
}
|
||||
|
||||
export async function unfoldCommand() {
|
||||
await editor.unfold();
|
||||
}
|
||||
|
||||
export async function foldAllCommand() {
|
||||
await editor.foldAll();
|
||||
}
|
||||
|
||||
export async function unfoldAllCommand() {
|
||||
await editor.unfoldAll();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user