syncEditors synchronizes the text [Editor] scrolling and cursor positions
(typ events.Types, e events.Event, name string)
| 199 | |
| 200 | // syncEditors synchronizes the text [Editor] scrolling and cursor positions |
| 201 | func (dv *DiffEditor) syncEditors(typ events.Types, e events.Event, name string) { |
| 202 | tva, tvb := dv.textEditors() |
| 203 | me, other := tva, tvb |
| 204 | if name == "text-b" { |
| 205 | me, other = tvb, tva |
| 206 | } |
| 207 | switch typ { |
| 208 | case events.Scroll: |
| 209 | other.Geom.Scroll.Y = me.Geom.Scroll.Y |
| 210 | other.ScrollUpdateFromGeom(math32.Y) |
| 211 | case events.Input: |
| 212 | if dv.inInputEvent { |
| 213 | return |
| 214 | } |
| 215 | dv.inInputEvent = true |
| 216 | other.SetCursorShow(me.CursorPos) |
| 217 | dv.inInputEvent = false |
| 218 | } |
| 219 | } |
| 220 | |
| 221 | // nextDiff moves to next diff region |
| 222 | func (dv *DiffEditor) nextDiff(ab int) bool { |
no test coverage detected