Type Editor / @type-editor/commands / util/helpers
util/helpers
Functions
| Function | Description |
|---|---|
Checks if the cursor is at the end of a textblock. This function determines whether the selection is a cursor positioned at the very end of a textblock. It uses the view (if provided) for accurate bidirectional text detection, which is important for languages with right-to-left text direction. | |
Checks if the cursor is at the start of a textblock. This function determines whether the selection is a cursor positioned at the very beginning of a textblock. It uses the view (if provided) for accurate bidirectional text detection, which is important for languages with right-to-left text direction. | |
Attempts to delete or join nodes separated by a structural barrier. This is a complex function that implements multiple strategies for handling deletion or joining when there's a structural barrier (like different node types or isolating nodes) between content. It tries several approaches in order:
This function is used by backward and forward joining commands to handle complex structural scenarios that simple joining can't handle. | |
Finds the position where a forward cut/join operation should occur. This function traverses up the document tree from the given position to find the nearest position where content can be joined or cut forward. It stops at isolating nodes (nodes marked with The function looks for the first ancestor level where there's a sibling node after the current position, indicating a valid cut point. | |
Finds the position where a backward cut/join operation should occur. This function traverses up the document tree from the given position to find the nearest position where content can be joined or cut backward. It stops at isolating nodes (nodes marked with The function looks for the first ancestor level where there's a sibling node before the current position, indicating a valid cut point. | |
Checks if a node contains a textblock at its start or end. This function traverses down from the given node to determine if there's a textblock accessible at the specified side. It navigates through the node hierarchy following either first or last children depending on the side. Example typescript |