forked from Silverquark/dance
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathview.ts
29 lines (26 loc) · 1 KB
/
view.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import * as vscode from "vscode";
import type { Argument } from ".";
import { Context, Selections } from "../api";
/**
* Moving the editor view.
*
* #### Predefined keybindings
*
* | Title | Keybinding | Command |
* | ----------------------- | -------------------------------------------- | ---------------------------------------------------- |
* | Show view menu | `z` (helix: normal), `z` (helix: select) | `[".openMenu", { menu: "view", ... }]` |
* | Show view menu (locked) | `s-z` (helix: normal), `s-z` (helix: select) | `[".openMenu", { menu: "view", locked: true, ... }]` |
*/
declare module "./view";
/**
* Reveals a position based on the main cursor.
*/
export function line(
_: Context,
at: Argument<"top" | "center" | "bottom"> = "center",
) {
return vscode.commands.executeCommand(
"revealLine",
{ at, lineNumber: Selections.activeLine(_.mainSelection) },
);
}