Added`Center Cursor` command
parent
2a697332e8
commit
1a33b213be
|
@ -26,6 +26,11 @@ functions:
|
|||
path: "./editor.ts:toggleDarkMode"
|
||||
command:
|
||||
name: "Editor: Toggle Dark Mode"
|
||||
centerCursor:
|
||||
path: "./editor.ts:centerCursorCommand"
|
||||
command:
|
||||
name: "Editor: Center Cursor"
|
||||
key: "Ctrl-Alt-l"
|
||||
clearPageIndex:
|
||||
path: "./page.ts:clearPageIndex"
|
||||
events:
|
||||
|
|
|
@ -37,3 +37,8 @@ export async function foldAllCommand() {
|
|||
export async function unfoldAllCommand() {
|
||||
await editor.unfoldAll();
|
||||
}
|
||||
|
||||
export async function centerCursorCommand() {
|
||||
const pos = await editor.getCursor();
|
||||
await editor.moveCursor(pos, true);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue