Delete line command (#866)
parent
827b08c21f
commit
0e3c5587f5
|
@ -1,4 +1,4 @@
|
|||
This folder contains two things:
|
||||
|
||||
* Wrappers for `syscall`s to be used by Plugs
|
||||
* Reusablee library code that plugs may find useful
|
||||
* Reusable library code that plugs may find useful
|
|
@ -211,3 +211,7 @@ export function openSearchPanel() {
|
|||
export function copyToClipboard(data: string | Blob): Promise<void> {
|
||||
return syscall("editor.copyToClipboard", data);
|
||||
}
|
||||
|
||||
export function deleteLine() {
|
||||
return syscall("editor.deleteLine");
|
||||
}
|
||||
|
|
|
@ -163,6 +163,12 @@ functions:
|
|||
name: "Navigate: Center Cursor"
|
||||
key: "Ctrl-Alt-l"
|
||||
requireMode: rw
|
||||
deleteLine:
|
||||
path: "./editor.ts:deleteLineCommand"
|
||||
command:
|
||||
name: "Delete Line"
|
||||
key: "Ctrl-d"
|
||||
requireMode: rw
|
||||
|
||||
# Debug commands
|
||||
parseCommand:
|
||||
|
|
|
@ -64,3 +64,7 @@ export function undoCommand() {
|
|||
export function redoCommand() {
|
||||
return editor.redo();
|
||||
}
|
||||
|
||||
export function deleteLineCommand() {
|
||||
return editor.deleteLine();
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@ import {
|
|||
unfoldAll,
|
||||
unfoldCode,
|
||||
} from "@codemirror/language";
|
||||
import { redo, undo } from "@codemirror/commands";
|
||||
import { deleteLine, redo, undo } from "@codemirror/commands";
|
||||
import { Transaction } from "@codemirror/state";
|
||||
import { EditorView } from "@codemirror/view";
|
||||
import { getCM as vimGetCm, Vim } from "@replit/codemirror-vim";
|
||||
|
@ -272,6 +272,9 @@ export function editorSyscalls(client: Client): SysCallMapping {
|
|||
context: client.getContext(),
|
||||
});
|
||||
},
|
||||
"editor.deleteLine": () => {
|
||||
deleteLine(client.editorView);
|
||||
},
|
||||
// Folding
|
||||
"editor.fold": () => {
|
||||
foldCode(client.editorView);
|
||||
|
|
Loading…
Reference in New Issue