TextSelection
A text selection represents a classical editor selection, with a head (the moving side) and anchor (immobile side), both of which point into textblock nodes. It can be empty (a regular cursor position).
class TextSelection extends Selection { }
getBookmark(): TextBookmark;
toJSON(): any;
§Properties
§
$cursor: ResolvedPos | null readonly
[src]Returns a resolved position if this is a cursor selection (an empty text selection), and null otherwise.
§Methods
§Static Methods
§
Return a text selection that spans the given positions or, if
they aren't text positions, find a text selection near them.
bias
determines whether the method searches forward (default)
or backwards (negative number) first. Will fall back to calling
Selection.near
when the document
doesn't contain a valid text position.