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

Method AdjustPosIfAfterTime

texteditor/text/edit.go:152–160  ·  view source on GitHub ↗

AdjustPosIfAfterTime checks the time stamp and IfAfterTime, it adjusts the given text position as a function of the edit del determines what to do with positions within a deleted region either move to start or end of the region, or return an error.

(pos lexer.Pos, t time.Time, del AdjustPosDel)

Source from the content-addressed store, hash-verified

150// del determines what to do with positions within a deleted region
151// either move to start or end of the region, or return an error.
152func (te *Edit) AdjustPosIfAfterTime(pos lexer.Pos, t time.Time, del AdjustPosDel) lexer.Pos {
153 if te == nil {
154 return pos
155 }
156 if te.Reg.IsAfterTime(t) {
157 return te.AdjustPos(pos, del)
158 }
159 return pos
160}
161
162// AdjustReg adjusts the given text region as a function of the edit, including
163// checking that the timestamp on the region is after the edit time, if

Callers

nothing calls this directly

Calls 2

AdjustPosMethod · 0.95
IsAfterTimeMethod · 0.80

Tested by

no test coverage detected