(code, state)
| 282 | this.data.at = undefined; |
| 283 | } |
| 284 | onStateChanged(code, state) { |
| 285 | if (state) { |
| 286 | let line = state.line; |
| 287 | if (line) { |
| 288 | let offset = code.hitOffset(0, code.lineHeight * (line - 1)); |
| 289 | let from = code.findLineBreak(offset, false); |
| 290 | let to = code.findLineBreak(offset, true); |
| 291 | code.select(from, to - from); |
| 292 | this.onReveal(code); |
| 293 | } |
| 294 | else { |
| 295 | let selection = state.selection; |
| 296 | if (selection) { |
| 297 | code.select(selection.offset, selection.length); |
| 298 | let scroll = state.scroll; |
| 299 | if (scroll) |
| 300 | code.container.scroll = scroll; |
| 301 | else |
| 302 | this.onReveal(code); |
| 303 | } |
| 304 | } |
| 305 | } |
| 306 | } |
| 307 | onStateChanging(code) { |
| 308 | this.data.state = { |
| 309 | scroll: code.container.scroll, |
no test coverage detected