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