Action

DelBel

Posted by 0xNuminous, Last update about 1 month ago

This actions deletes everything below 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 start to the cursor position
    let contentUpToCursor = draftContent.substring(0, cursorPosition);
    
    // Step 4: Replace the draft content with only the portion up to the cursor
    draft.content = contentUpToCursor;
    
    // Step 5: Save the updated draft
    draft.update();

Options

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