Mercurial > vim
comparison src/diff.c @ 10821:d9e48fb5142f v8.0.0300
patch 8.0.0300: cannot stop diffing hidden buffers
commit https://github.com/vim/vim/commit/25ea0544587dd45088512fec9d7a685e35fea679
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Feb 3 23:16:28 2017 +0100
patch 8.0.0300: cannot stop diffing hidden buffers
Problem: Cannot stop diffing hidden buffers. (Daniel Hahler)
Solution: When using :diffoff! make the whole list if diffed buffers empty.
(closes #736)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Fri, 03 Feb 2017 23:30:04 +0100 |
parents | d0b74b18e4b5 |
children | d2178a6cc9f3 |
comparison
equal
deleted
inserted
replaced
10820:37ad103a548a | 10821:d9e48fb5142f |
---|---|
134 diff_redraw(TRUE); | 134 diff_redraw(TRUE); |
135 return; | 135 return; |
136 } | 136 } |
137 | 137 |
138 EMSGN(_("E96: Cannot diff more than %ld buffers"), DB_COUNT); | 138 EMSGN(_("E96: Cannot diff more than %ld buffers"), DB_COUNT); |
139 } | |
140 | |
141 /* | |
142 * Remove all buffers to make diffs for. | |
143 */ | |
144 static void | |
145 diff_buf_clear(void) | |
146 { | |
147 int i; | |
148 | |
149 for (i = 0; i < DB_COUNT; ++i) | |
150 if (curtab->tp_diffbuf[i] != NULL) | |
151 { | |
152 curtab->tp_diffbuf[i] = NULL; | |
153 curtab->tp_diff_invalid = TRUE; | |
154 diff_redraw(TRUE); | |
155 } | |
139 } | 156 } |
140 | 157 |
141 /* | 158 /* |
142 * Find buffer "buf" in the list of diff buffers for the current tab page. | 159 * Find buffer "buf" in the list of diff buffers for the current tab page. |
143 * Return its index or DB_COUNT if not found. | 160 * Return its index or DB_COUNT if not found. |
1255 #ifdef FEAT_SCROLLBIND | 1272 #ifdef FEAT_SCROLLBIND |
1256 diffwin |= wp->w_p_diff; | 1273 diffwin |= wp->w_p_diff; |
1257 #endif | 1274 #endif |
1258 } | 1275 } |
1259 | 1276 |
1277 /* Also remove hidden buffers from the list. */ | |
1278 if (eap->forceit) | |
1279 diff_buf_clear(); | |
1280 | |
1260 #ifdef FEAT_SCROLLBIND | 1281 #ifdef FEAT_SCROLLBIND |
1261 /* Remove "hor" from from 'scrollopt' if there are no diff windows left. */ | 1282 /* Remove "hor" from from 'scrollopt' if there are no diff windows left. */ |
1262 if (!diffwin && vim_strchr(p_sbo, 'h') != NULL) | 1283 if (!diffwin && vim_strchr(p_sbo, 'h') != NULL) |
1263 do_cmdline_cmd((char_u *)"set sbo-=hor"); | 1284 do_cmdline_cmd((char_u *)"set sbo-=hor"); |
1264 #endif | 1285 #endif |