Record of a single edit to a text_buffer: the range that
was replaced and the text that replaced it. text_change
objects are the payload of the text_buffer<-changes
chain and let editor,
fragment and view follow the buffer's edit
history.
Positions are 0-based and use UTF-16 code units to match the LSP/DOM
conventions other parts of xpce talk to.
- See also
-
- class text_buffer
- class fragment
- class editor
- text_change <-
start_line: int
-
0-based line where the change starts.
- text_change <-
start_position: int
-
0-based position on text_change
<-start_line,
counted in UTF-16 units.
- text_change <-
end_line: int
-
0-based line where the change ends.
- text_change <-
end_position: int
-
0-based position on text_change
<-end_line,
counted in UTF-16 units.
- text_change <-
length: int
-
Length of the replaced region, in UTF-16 units.
- text_change <-
replacement: string*
-
Text used to replace the region (@nil
for a pure deletion).
- text_change ->initialise: start_line=int,
start_position=int, end_line=[int], end_position=[int], length=[int],
replacement=[string*]
-
Build a change record from its range and replacement text.
end_line/end_position default to start; length
defaults to 0.
- text_change <-size: -> int
-
Approximate size of this change in bytes (its memory footprint). Used by
text_buffer
when bounding the size of the undo/redo history.