XCBufferP - XcodeExtKit/XcodeExtBase GitHub Wiki

XCBufferP

public protocol XCBufferP

Requirements

insert(_:​after:​)

@discardableResult func insert(_ str: Str, after index: Int) -> Bool

insertAfterSelection(_:​)

@discardableResult func insertAfterSelection(_ str: Str) -> Bool

addAtTheBottom(_:​)

insert text at the very bottom

func addAtTheBottom(_ str: Str)

removeSelectedLines()

@discardableResult func removeSelectedLines() -> Bool

replaceSelectedLines(with:​)

@discardableResult func replaceSelectedLines(with str: Str) -> Bool

selectLines(startIndex:​endIndex:​)

@discardableResult func selectLines(startIndex: Int, endIndex: Int) -> Bool

selectedLineIndexes

returns selected line indexes, if any

var selectedLineIndexes: Set<Int>?

lastSelectedLineIdx

returns last selected line indexe, if any is selected

var lastSelectedLineIdx: Int?

selectedLines

returns selected lines (if any), trimmed from newLine, in line order

var selectedLines: [Str]?

selectedRange

var selectedRange: NSRange?

selectedXCRange

var selectedXCRange: XCRangeP?

select(_:​)

@discardableResult func select(_ rng: XCRangeP) -> Bool

hasSelection

var hasSelection: Bool

_lines

var _lines: [Str]

lines(in:​)

func lines(in rng: NSRange) -> [Str]

finalText

The complete buffer's string representation, as a convenience. Changes to lines are immediately reflected in this property, and vice versa

var finalText: Str
⚠️ **GitHub.com Fallback** ⚠️