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

Method nextDiff

texteditor/diffeditor.go:222–246  ·  view source on GitHub ↗

nextDiff moves to next diff region

(ab int)

Source from the content-addressed store, hash-verified

220
221// nextDiff moves to next diff region
222func (dv *DiffEditor) nextDiff(ab int) bool {
223 tva, tvb := dv.textEditors()
224 tv := tva
225 if ab == 1 {
226 tv = tvb
227 }
228 nd := len(dv.alignD)
229 curLn := tv.CursorPos.Ln
230 di, df := dv.alignD.DiffForLine(curLn)
231 if di < 0 {
232 return false
233 }
234 for {
235 di++
236 if di >= nd {
237 return false
238 }
239 df = dv.alignD[di]
240 if df.Tag != 'e' {
241 break
242 }
243 }
244 tva.SetCursorTarget(lexer.Pos{Ln: df.I1})
245 return true
246}
247
248// prevDiff moves to previous diff region
249func (dv *DiffEditor) prevDiff(ab int) bool {

Callers 1

MakeToolbarMethod · 0.95

Calls 3

textEditorsMethod · 0.95
DiffForLineMethod · 0.80
SetCursorTargetMethod · 0.80

Tested by

no test coverage detected