How to detect document new line or delete line

I would like to know how to add or delete a row, can it be done?

The .breakpoint file is stored locally to record breakpoints. To delete lines, I need to delete the local corresponding breakpoint records.

I’m new to codemirror and don’t have any ideas. The breakpoint implementation is the official gutter demo. Thanks

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.

Thanks for the reply, thumbs up for you