-
Notifications
You must be signed in to change notification settings - Fork 0
vtf textbuffer ChunkBuffer
class buffer.ChunkBuffer(TextBuffer) ¶
[ ADVANCED USAGE ]
Create a restricted editable buffer from a chunk in memory.
>>> with ChunkBuffer(<buffer>, <position>, <do not overwrite chunk slot>, <delete chunk from swap if empty>) as cb: >>> cb.[...] >>> ... # overwrites chunk and adjusts the metadata index hereBasically the methods of the TextBuffer should not be used in the
ChunkBufferto avoid recursion and data corruption. However, if methods are used, the following may raise anAttributeError, since the entries for ChunkIter andChunkBufferin theChunkBufferare deleted:
write(when a substitution mode is selected)rowworkremovefindgoto_row__marker__.marked_remove__local_history__.undo__local_history__.redo__local_history__.branch_forkIf the sandbox is not set, these following components are avalable in the
ChunkBufferbut referencing toTextBuffer:
__marker____local_history____display____glob_cursor__The
__diffs__and__empty__attributes are not set until the override.__diffs__consists of the differences of (data length, content length, row number, line number) and__empty__indicates whether the chunk is empty after overwriting, can beNoneif the current buffer is loaded into a ChunkBuffer.__chunk_pos_id__: int | None
__chunk_slot__: int | None
__diffs__: tuple[int, int, int, int]
__empty__: bool | None
strip() -> None ¶
An empty row is automatically appended by the buffer after a line break, this method removes the row line in the buffer if it is empty.
| Date: | 21 Dec 2022 |
|---|---|
| Version: | 0.1 |
| Author: | Adrian Hoefflin [srccircumflex] |
| Doc-Generator: | "pyiStructure-RSTGenerator" <prototype> |
