The demo breakpoint implementation already tracks changed positions of breakpoints in its update method, by calling set.map. You could, in an updateListener check if update.changes adds or deletes and breakpoints (by iterating over its changed ranges), and store the current breakpoint positions if it does.