Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Provisional API: This reference documents current compiler behavior. Compatibility is not yet promised.

src/sourceview.x

Request-owned source overlays.

Functions

FunctionSummary
SourceView.existsReturns readable-file presence, including unsaved new files.
SourceView.initInitializes empty overlays in the current request lifetime.
SourceView.is_changedReturns whether this logical file has an unsaved overlay.
SourceView.readReads through the request overlay, falling back to a regular disk file.
SourceView.setStores an immutable snapshot under its logical source path.

SourceView

SourceView.exists

int SourceView.exists(SourceView sources, String path)

Returns readable-file presence, including unsaved new files.

Source: src/sourceview.x:46

SourceView.init

void SourceView.init(SourceView sources)

Initializes empty overlays in the current request lifetime.

Source: src/sourceview.x:28

SourceView.is_changed

int SourceView.is_changed(SourceView sources, String path)

Returns whether this logical file has an unsaved overlay.

Source: src/sourceview.x:42

SourceView.read

int SourceView.read(SourceView sources, String path, String volatile &text)

Reads through the request overlay, falling back to a regular disk file. The return value distinguishes an empty file from a failed read. Disk text belongs to the calling unit; configured snapshots remain borrowed.

Source: src/sourceview.x:56

SourceView.set

void SourceView.set(SourceView s, String path, String text, int changed)

Stores an immutable snapshot under its logical source path. Empty text is a present snapshot, not a request to fall back to the disk file.

Source: src/sourceview.x:36

Public types

TypeKindSummary
SourceViewclassOwns configured immutable overlays in the request’s active Context.

SourceView

class SourceView struct { Map overlays, dirty_paths; } *

Owns configured immutable overlays in the request’s active Context. A frontend and its units borrow this view. Text read from disk belongs to the reading unit, so the view never caches that shorter-lived text.

Source: src/sourceview.x:17

Design notes

Logical paths keep their identity when an editor supplies unsaved text. Configure this view before opening a frontend unit; its immutable values and Map must outlive every compiler borrowing it.