Skip to content

vtf txb _buffercomponents globcursor

srccircumflex edited this page Apr 24, 2023 · 4 revisions

↑ vtf-txb-_buffercomponents

globcursor

class globcursor._GlobCursor

Buffer Component as memory and handler for the global cursor position on the x-axis and cursor anchors.

From here█ the cusror is moved down twice (on the y axis).
line█
As long a█ the cursor is not moved on the x-axis, it will be tried to set it on the last x position.

Anchors are not fully _LocalHistory compatible and will be deleted irreversibly on range removal, if there is an anchor in the range.

cursor_anchors: list[tuple[int | str, int]]

glob_column_change: bool

glob_column_val: int

add_anchor(key, anchor=None) -> None

Add anchor (by default the current cursor position) under key to the memory.

The plausibility of anchor compared to the existing data is not checked

raises:
  • KeyError(parameters): if the key is already assigned. The error can be processed by add_anchor_by_err.

add_anchor_by_err(error) -> None

Set an anchor by the error from add_anchor.

get_anchor(key) -> tuple[int | str, int]

Return the anchor item with key.

raises:
  • KeyError(key): if key is not present.

get_anchor_by_position(position=None) -> tuple[int | str, int]

Return the anchor item with position.

raises:
  • KeyError(position): if anchor with position is not present.

get_globc(__new) -> int

Query the global x-position, set it to new before if flagged for change.

goto_anchor(key) -> ChunkLoad

Query the anchor with key and move the cursor there.

raises:
  • KeyError: if key is not present.
  • EOFError(0, msg): if n is not in the range of the currently loaded chunks and the chunks of the required side cannot be loaded completely/are not available.
  • EOFError(1, msg): Chunks of the required side could not be loaded sufficiently. The closest chunk was loaded and the cursor was placed at the beginning of the first row.
  • EOFError(2, msg): if an error occurs during the final setting of the cursor (indicator of too high value). The cursor was set to the next possible position.
  • AssertionError: __local_history__ lock is engaged.

note_globc() -> None

Change the global x-position on the next query.

pop_anchor(key) -> tuple[int | str, int]

Return the anchor item with key and pop them from cache.

raises:
  • KeyError(key): if key is not present.

pop_anchor_by_position(position=None) -> tuple[int | str, int]

Return the anchor item with position and pop them from cache.

raises:
  • KeyError(position): if anchor with position is not present.

purge_anchors() -> list[tuple[int | str, int]]

Clear and return the anchor memory.

set_globc(__n) -> None

Set the global x-position.

Date: 20 Dec 2022
Version: 0.1
Author: Adrian Hoefflin [srccircumflex]
Doc-Generator: "pyiStructure-RSTGenerator" <prototype>

Clone this wiki locally