I made a tiny plugin to handle this for myself, but it would be something that would fit inside this project and probably be implemented better:
I use ⌘E to kill the current line. Wherever my cursor is, the entire line is deleted. If I have a selection that spans multiple lines, they're all deleted.
Most importantly, this command does not need you to highlight exactly the whole line or entire text you want to be deleted, just wherever your cursor is, whatever you have highlighted, or wherever your multiple cursors are, each line involved is deleted
This is what I did, there is probably a better way to do it:
nova.commands.register("example.delete-lines", (editor) => {
editor.selectLinesContainingCursors();
editor.edit((actionQueue) => {
// When multiple cursors are involved, ranges must be deleted bottom-up
// so it can be performed as one atomic commit
editor.selectedRanges.reverse().forEach((range) => {
actionQueue.delete(range);
});
});
});
I made a tiny plugin to handle this for myself, but it would be something that would fit inside this project and probably be implemented better:
I use ⌘E to kill the current line. Wherever my cursor is, the entire line is deleted. If I have a selection that spans multiple lines, they're all deleted.
Most importantly, this command does not need you to highlight exactly the whole line or entire text you want to be deleted, just wherever your cursor is, whatever you have highlighted, or wherever your multiple cursors are, each line involved is deleted
This is what I did, there is probably a better way to do it: