MCPcopy Create free account
hub / github.com/cogentcore/core / indentLine

Method indentLine

texteditor/buffer.go:893–899  ·  view source on GitHub ↗

Indenting see parse/lexer/indent.go for support functions indentLine indents line by given number of tab stops, using tabs or spaces, for given tab size (if using spaces) -- either inserts or deletes to reach target. Returns edit record for any change.

(ln, ind int)

Source from the content-addressed store, hash-verified

891// for given tab size (if using spaces) -- either inserts or deletes to reach target.
892// Returns edit record for any change.
893func (tb *Buffer) indentLine(ln, ind int) *text.Edit {
894 autoSave := tb.batchUpdateStart()
895 defer tb.batchUpdateEnd(autoSave)
896 tbe := tb.Lines.IndentLine(ln, ind)
897 tb.signalMods()
898 return tbe
899}
900
901// AutoIndentRegion does auto-indent over given region; end is *exclusive*
902func (tb *Buffer) AutoIndentRegion(start, end int) {

Callers

nothing calls this directly

Calls 4

batchUpdateStartMethod · 0.95
batchUpdateEndMethod · 0.95
signalModsMethod · 0.95
IndentLineMethod · 0.65

Tested by

no test coverage detected