-
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
ChunkBuffer
to avoid recursion and data corruption. However, if methods are used, the following may raise anAttributeError
, since the entries for ChunkIter andChunkBuffer
in theChunkBuffer
are deleted:
write
(when a substitution mode is selected)rowwork
remove
find
goto_row
__marker__.marked_remove
__local_history__.undo
__local_history__.redo
__local_history__.branch_fork
If the sandbox is not set, these following components are avalable in the
ChunkBuffer
but 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 beNone
if 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> |