Move set_margin_style function to buffer module