Merge pull request #1024 from war1025/dev/for_all_buffers

Add FOR_ALL_BUFFERS helper
This commit is contained in:
Justin M. Keyes
2014-08-19 23:49:25 -04:00
16 changed files with 145 additions and 131 deletions

View File

@@ -7677,7 +7677,6 @@ static void paste_option_changed(void)
static int save_ru = 0;
static int save_ri = 0;
static int save_hkmap = 0;
buf_T *buf;
if (p_paste) {
/*
@@ -7686,7 +7685,7 @@ static void paste_option_changed(void)
*/
if (!old_p_paste) {
/* save options for each buffer */
for (buf = firstbuf; buf != NULL; buf = buf->b_next) {
FOR_ALL_BUFFERS(buf) {
buf->b_p_tw_nopaste = buf->b_p_tw;
buf->b_p_wm_nopaste = buf->b_p_wm;
buf->b_p_sts_nopaste = buf->b_p_sts;
@@ -7710,7 +7709,7 @@ static void paste_option_changed(void)
* already on.
*/
/* set options for each buffer */
for (buf = firstbuf; buf != NULL; buf = buf->b_next) {
FOR_ALL_BUFFERS(buf) {
buf->b_p_tw = 0; /* textwidth is 0 */
buf->b_p_wm = 0; /* wrapmargin is 0 */
buf->b_p_sts = 0; /* softtabstop is 0 */
@@ -7735,7 +7734,7 @@ static void paste_option_changed(void)
*/
else if (old_p_paste) {
/* restore options for each buffer */
for (buf = firstbuf; buf != NULL; buf = buf->b_next) {
FOR_ALL_BUFFERS(buf) {
buf->b_p_tw = buf->b_p_tw_nopaste;
buf->b_p_wm = buf->b_p_wm_nopaste;
buf->b_p_sts = buf->b_p_sts_nopaste;