Action

DelAbo

Posted by 0xNuminous, Last update 4 months ago

Deletes everything above the cursor

Steps

  • script

    // Step 1: Get the current cursor position
    let cursorPosition = editor.getSelectedRange()[0];
    
    // Step 2: Get the full content of the draft
    let draftContent = draft.content;
    
    // Step 3: Slice the content from the cursor position to the end
    let contentFromCursor = draftContent.substring(cursorPosition);
    
    // Step 4: Replace the draft content with only the portion from the cursor position
    draft.content = contentFromCursor;
    
    // Step 5: Save the updated draft
    draft.update();

Options

  • After Success Default
    Notification Info
    Log Level Info
Items available in the Drafts Directory are uploaded by community members. Use appropriate caution reviewing downloaded items before use.