Skip to main content

Module buffer_io

Module buffer_io 

Source
Expand description

B1: writing a whole buffer, in one place.

Every magit mode replaces its buffer’s entire contents after a git command returns, and every one of them spelled out the same six lines: snapshot, find the last line, build the end position, one Edit::replace over the lot. Ten sites — five as a private apply_full_replace copied verbatim between modes (identical to the byte), five inlined into on_activate without even a name.