replace `viewport_bline` with `viewport_mark`.
`bview_t.viewport_bline` is a pointer to the line where we want to begin rendering the buffer. if an action takes place that frees the line pointed to by `viewport_bline`, and we don't safely update `viewport_bline` before using it, we can potentially segfault. this happened while playing around with coarse_undo (feature coming shortly), in which `_bview_buffer_callback` attempted to use `viewport_bline` after it had been freed. marks are already maintained within buffer code, including the case of a mark's line getting deleted. all buffer operations are guaranteed to rectify all marks before returning, so it is safer to use a mark instead of a bline pointer to denote the viewport.
parent
171f52b5
Please register or sign in to comment