Inherits from NSDocument
Conforms to NSLayoutManagerDelegate
NSTextStorageDelegate
NSTextViewDelegate
ViDeferredDelegate
ViViewDocument
Declared in ViDocument.h

Overview

A document.

Tasks

Other Methods

Working with scopes

Properties

textStorage

Return the ViTextStorage object.

@property (nonatomic, readonly) ViTextStorage *textStorage

Declared In

ViDocument.h

views

The set of visible views of the document.

@property (nonatomic, readonly) NSSet *views

Return Value

The set of visible views of the document.

Declared In

ViTabController.h

Instance Methods

addView:

Add a view to the set of visible views.

- (void)addView:(ViDocumentView *)aDocumentView

Parameters

viewController

The view to add.

Declared In

ViTabController.h

bestMatchingScope:atLocation:

Find the best matching scope selector.

- (NSString *)bestMatchingScope:(NSArray *)scopeSelectors atLocation:(NSUInteger)aLocation

Parameters

scopeSelectors

Scope selectors to test.

aLocation

The location of the scope.

Return Value

The scope selector with the highest matching rank at the given location.

Declared In

ViDocument.h

cloneView:

Create a new view of the document by cloning an existing view.

- (ViDocumentView *)cloneView:(ViDocumentView *)oldView

Parameters

oldView

The view that is being cloned.

Return Value

The newly created view of the document.

Discussion

The new view is expected to inherit properties from the cloned view, such as caret location.

Declared In

ViTabController.h

language

Get the language syntax.

- (ViLanguage *)language

Return Value

The language syntax currently in use, or nil if no language configured.

Declared In

ViDocument.h

makeView

Create a new view of the document.

- (ViDocumentView *)makeView

Return Value

The newly created view of the document.

Declared In

ViTabController.h

rangeOfScopeSelector:atLocation:

Find the range where a scope selector matches.

- (NSRange)rangeOfScopeSelector:(NSString *)scopeSelector atLocation:(NSUInteger)aLocation

Parameters

scopeSelector

Scope selectors to test.

aLocation

A location where the scope selector matches.

Return Value

The whole range where the scope selector matches, possibly with different ranks.

Declared In

ViDocument.h

removeView:

Remove a view from the set of visible views.

- (void)removeView:(ViDocumentView *)aDocumentView

Parameters

viewController

The view to remove.

Declared In

ViTabController.h

scopeAtLocation:

Return the scope at a given location.

- (ViScope *)scopeAtLocation:(NSUInteger)aLocation

Parameters

aLocation

The location of the scope.

Return Value

The scope at the given location, or nil of aLocation is not valid or no language syntax available.

Declared In

ViDocument.h

text

Return a scriptable text view.

- (ViTextView *)text

Return Value

A scriptable text view.

Discussion

The returned text view is not visible.

Declared In

ViDocument.h