Mercurial > vim
comparison src/buffer.c @ 14175:2ad722003b36 v8.1.0105
patch 8.1.0105: all tab stops are the same
commit https://github.com/vim/vim/commit/04958cbaf25eea27eceedaa987adfb354ad5f7fd
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Jun 23 19:23:02 2018 +0200
patch 8.1.0105: all tab stops are the same
Problem: All tab stops are the same.
Solution: Add the variable tabstop feature. (Christian Brabandt,
closes #2711)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 23 Jun 2018 19:30:07 +0200 |
parents | 1d25a3e8e03c |
children | 4a94173743d9 |
comparison
equal
deleted
inserted
replaced
14174:d36eedd19166 | 14175:2ad722003b36 |
---|---|
269 } | 269 } |
270 | 270 |
271 /* | 271 /* |
272 * Set/reset the Changed flag first, autocmds may change the buffer. | 272 * Set/reset the Changed flag first, autocmds may change the buffer. |
273 * Apply the automatic commands, before processing the modelines. | 273 * Apply the automatic commands, before processing the modelines. |
274 * So the modelines have priority over auto commands. | 274 * So the modelines have priority over autocommands. |
275 */ | 275 */ |
276 /* When reading stdin, the buffer contents always needs writing, so set | 276 /* When reading stdin, the buffer contents always needs writing, so set |
277 * the changed flag. Unless in readonly mode: "ls | gview -". | 277 * the changed flag. Unless in readonly mode: "ls | gview -". |
278 * When interrupted and 'cpoptions' contains 'i' set changed flag. */ | 278 * When interrupted and 'cpoptions' contains 'i' set changed flag. */ |
279 if ((got_int && vim_strchr(p_cpo, CPO_INTMOD) != NULL) | 279 if ((got_int && vim_strchr(p_cpo, CPO_INTMOD) != NULL) |
2157 clear_string_option(&buf->b_p_kp); | 2157 clear_string_option(&buf->b_p_kp); |
2158 clear_string_option(&buf->b_p_mps); | 2158 clear_string_option(&buf->b_p_mps); |
2159 clear_string_option(&buf->b_p_fo); | 2159 clear_string_option(&buf->b_p_fo); |
2160 clear_string_option(&buf->b_p_flp); | 2160 clear_string_option(&buf->b_p_flp); |
2161 clear_string_option(&buf->b_p_isk); | 2161 clear_string_option(&buf->b_p_isk); |
2162 #ifdef FEAT_VARTABS | |
2163 clear_string_option(&buf->b_p_vsts); | |
2164 if (buf->b_p_vsts_nopaste) | |
2165 vim_free(buf->b_p_vsts_nopaste); | |
2166 buf->b_p_vsts_nopaste = NULL; | |
2167 if (buf->b_p_vsts_array) | |
2168 vim_free(buf->b_p_vsts_array); | |
2169 buf->b_p_vsts_array = NULL; | |
2170 clear_string_option(&buf->b_p_vts); | |
2171 if (buf->b_p_vts_array) | |
2172 vim_free(buf->b_p_vts_array); | |
2173 buf->b_p_vts_array = NULL; | |
2174 #endif | |
2162 #ifdef FEAT_KEYMAP | 2175 #ifdef FEAT_KEYMAP |
2163 clear_string_option(&buf->b_p_keymap); | 2176 clear_string_option(&buf->b_p_keymap); |
2164 keymap_clear(&buf->b_kmap_ga); | 2177 keymap_clear(&buf->b_kmap_ga); |
2165 ga_clear(&buf->b_kmap_ga); | 2178 ga_clear(&buf->b_kmap_ga); |
2166 #endif | 2179 #endif |
5188 && !(wp->w_closing || wp->w_buffer->b_locked > 0)) | 5201 && !(wp->w_closing || wp->w_buffer->b_locked > 0)) |
5189 { | 5202 { |
5190 win_close(wp, FALSE); | 5203 win_close(wp, FALSE); |
5191 wpnext = firstwin; /* just in case an autocommand does | 5204 wpnext = firstwin; /* just in case an autocommand does |
5192 something strange with windows */ | 5205 something strange with windows */ |
5193 tpnext = first_tabpage; /* start all over...*/ | 5206 tpnext = first_tabpage; /* start all over... */ |
5194 open_wins = 0; | 5207 open_wins = 0; |
5195 } | 5208 } |
5196 else | 5209 else |
5197 ++open_wins; | 5210 ++open_wins; |
5198 } | 5211 } |
5648 { | 5661 { |
5649 return buf != NULL && buf->b_p_bt[0] == 'p'; | 5662 return buf != NULL && buf->b_p_bt[0] == 'p'; |
5650 } | 5663 } |
5651 | 5664 |
5652 /* | 5665 /* |
5653 * Return TRUE if "buf" is a "nofile", "acwrite" or "terminal" buffer. | 5666 * Return TRUE if "buf" is a "nofile", "acwrite", "terminal" or "prompt" |
5654 * This means the buffer name is not a file name. | 5667 * buffer. This means the buffer name is not a file name. |
5655 */ | 5668 */ |
5656 int | 5669 int |
5657 bt_nofile(buf_T *buf) | 5670 bt_nofile(buf_T *buf) |
5658 { | 5671 { |
5659 return buf != NULL && ((buf->b_p_bt[0] == 'n' && buf->b_p_bt[2] == 'f') | 5672 return buf != NULL && ((buf->b_p_bt[0] == 'n' && buf->b_p_bt[2] == 'f') |
5661 || buf->b_p_bt[0] == 't' | 5674 || buf->b_p_bt[0] == 't' |
5662 || buf->b_p_bt[0] == 'p'); | 5675 || buf->b_p_bt[0] == 'p'); |
5663 } | 5676 } |
5664 | 5677 |
5665 /* | 5678 /* |
5666 * Return TRUE if "buf" is a "nowrite", "nofile" or "terminal" buffer. | 5679 * Return TRUE if "buf" is a "nowrite", "nofile", "terminal" or "prompt" |
5680 * buffer. | |
5667 */ | 5681 */ |
5668 int | 5682 int |
5669 bt_dontwrite(buf_T *buf) | 5683 bt_dontwrite(buf_T *buf) |
5670 { | 5684 { |
5671 return buf != NULL && (buf->b_p_bt[0] == 'n' | 5685 return buf != NULL && (buf->b_p_bt[0] == 'n' |