prevDiff moves to previous diff region
(ab int)
| 247 | |
| 248 | // prevDiff moves to previous diff region |
| 249 | func (dv *DiffEditor) prevDiff(ab int) bool { |
| 250 | tva, tvb := dv.textEditors() |
| 251 | tv := tva |
| 252 | if ab == 1 { |
| 253 | tv = tvb |
| 254 | } |
| 255 | curLn := tv.CursorPos.Ln |
| 256 | di, df := dv.alignD.DiffForLine(curLn) |
| 257 | if di < 0 { |
| 258 | return false |
| 259 | } |
| 260 | for { |
| 261 | di-- |
| 262 | if di < 0 { |
| 263 | return false |
| 264 | } |
| 265 | df = dv.alignD[di] |
| 266 | if df.Tag != 'e' { |
| 267 | break |
| 268 | } |
| 269 | } |
| 270 | tva.SetCursorTarget(lexer.Pos{Ln: df.I1}) |
| 271 | return true |
| 272 | } |
| 273 | |
| 274 | // saveAs saves A or B edits into given file. |
| 275 | // It checks for an existing file, prompts to overwrite or not. |
no test coverage detected